fixed 404

This commit is contained in:
Christian Krakau-Louis
2025-03-25 22:11:44 +01:00
parent 426e3af0f6
commit ff1f6e042c
4 changed files with 104 additions and 56 deletions
+1 -5
View File
@@ -20,10 +20,6 @@ from app.api import router as api_router
from app.frontend import router as frontend_router
from app.auth import router as auth_router
BASE_DIR = Path(__file__).resolve().parent # this is /app in many Docker setups
FRONTEND_DIR = BASE_DIR / "frontend"
# Load configuration from .env for the session key
config = Config(".env")
@@ -173,7 +169,7 @@ async def ui_upload(file: UploadFile = File(...)):
@app.exception_handler(404)
async def custom_404_handler(request: Request, exc: HTTPException):
return FileResponse(
FRONTEND_DIR / "404.html",
"/app/frontend/404.html",
status_code=status.HTTP_404_NOT_FOUND
)