This commit is contained in:
2025-09-14 17:15:48 +00:00
commit 4dee2bb54c
40 changed files with 739 additions and 0 deletions

18
app/main.py Normal file
View File

@@ -0,0 +1,18 @@
from fastapi import FastAPI
from . import database, models, api
from app.api import router as api_router
app = FastAPI()
app.include_router(api_router, prefix="/api")
@app.on_event("startup")
async def startup():
async with database.engine.begin() as conn:
await conn.run_sync(models.Base.metadata.create_all)
@app.get("/{full_path:path}")
async def serve_spa(full_path: str):
index_path = os.path.join(dist_path, "index.html")
return FileResponse(index_path)