INNER CODE UNIT · Python
spa_fallback
CronusL-1141/AI-company · src/aiteam/api/app.py:227
async def spa_fallback(path: str) -> FileResponse:
if path.startswith("api/") or path.startswith("assets/") or path.startswith("mcp"):
raise HTTPException(status_code=404)
index = _dist_dir / "index.html"
if index.exists():
return FileResponse(str(index))
raise HTTPException(status_code=404)
return app