New structure

This commit is contained in:
2025-04-21 13:50:51 +02:00
parent 1eba79cc5a
commit abe0cbb173
45 changed files with 10 additions and 50 deletions

View File

@@ -0,0 +1,15 @@
from fastapi.staticfiles import StaticFiles
from starlette.responses import Response
from starlette.exceptions import HTTPException
class SPAStaticFiles(StaticFiles):
async def get_response(self, path: str, scope) -> Response:
try:
return await super().get_response(path, scope)
except HTTPException:
if path.startswith("/api"):
raise
return await super().get_response("index.html", scope)