feat: graph browser

This commit is contained in:
2026-04-04 16:18:21 +02:00
parent 72ff02dbdf
commit 3132d40391
10 changed files with 735 additions and 443 deletions

View File

@@ -28,7 +28,16 @@ async def health():
return {"status": "ok"}
# Serve built frontend as static files (SPA fallback)
# Serve built frontend as static files with SPA fallback
static_dir = Path(__file__).parent / "static"
if static_dir.is_dir():
app.mount("/", StaticFiles(directory=str(static_dir), html=True), name="static")
from fastapi.responses import FileResponse
app.mount("/assets", StaticFiles(directory=str(static_dir / "assets")), name="assets")
@app.get("/{path:path}")
async def spa_fallback(path: str):
file = static_dir / path
if file.is_file():
return FileResponse(file)
return FileResponse(static_dir / "index.html")