AhmadYarAI commited on
Commit
750b124
·
1 Parent(s): 6410f4f

feat: add invoice creation logic with SQLAlchemy

Browse files
Files changed (1) hide show
  1. main.py +3 -6
main.py CHANGED
@@ -9,7 +9,8 @@ from api.invoices import router as invoice_router
9
  Base.metadata.create_all(bind=engine)
10
 
11
  app = FastAPI(title="SmiloCAD Invoice API")
12
-
 
13
 
14
  app.add_middleware(
15
  CORSMiddleware,
@@ -20,14 +21,10 @@ app.add_middleware(
20
 
21
  # 1. Route to serve the index.html
22
  @app.get("/")
23
- async def read_index():
24
- # Looks for frontend/index.html
25
  return FileResponse("../frontend/index.html")
26
-
27
  # 2. Mount the CSS and JS folders so the HTML can find them
28
  # This matches your folder names: frontend/css and frontend/js
29
- app.mount("/css", StaticFiles(directory="../frontend/css"), name="css")
30
- app.mount("/js", StaticFiles(directory="../frontend/js"), name="js")
31
 
32
  # Include the routes from the api folder
33
  app.include_router(invoice_router)
 
9
  Base.metadata.create_all(bind=engine)
10
 
11
  app = FastAPI(title="SmiloCAD Invoice API")
12
+ app.mount("/css", StaticFiles(directory="../frontend/css"), name="css")
13
+ app.mount("/js", StaticFiles(directory="../frontend/js"), name="js")
14
 
15
  app.add_middleware(
16
  CORSMiddleware,
 
21
 
22
  # 1. Route to serve the index.html
23
  @app.get("/")
24
+ async def serve_index():
 
25
  return FileResponse("../frontend/index.html")
 
26
  # 2. Mount the CSS and JS folders so the HTML can find them
27
  # This matches your folder names: frontend/css and frontend/js
 
 
28
 
29
  # Include the routes from the api folder
30
  app.include_router(invoice_router)