Upload a File
++ Drag & drop a file here, or click to select a file. +
+ +diff --git a/app/frontend.py b/app/frontend.py index 7a3a8f39..920ce22a 100644 --- a/app/frontend.py +++ b/app/frontend.py @@ -1,5 +1,5 @@ # app/frontend.py (new file or inline in main.py) -from fastapi import APIRouter, Request +from fastapi import APIRouter, Request, status from fastapi.responses import FileResponse from fastapi.staticfiles import StaticFiles from app.auth import require_login @@ -24,4 +24,8 @@ async def serve_upload(request: Request): # 3) Serve favicon.ico from the frontend folder @router.get("/favicon.ico", response_class=FileResponse) def favicon(): - return os.path.join(frontend_folder, "favicon.ico") \ No newline at end of file + return os.path.join(frontend_folder, "favicon.ico") + +@app.exception_handler(404) +async def custom_404_handler(request: Request, exc): + return FileResponse("frontend/404.html", status_code=status.HTTP_404_NOT_FOUND) \ No newline at end of file diff --git a/frontend/404.html b/frontend/404.html new file mode 100644 index 00000000..20086e75 --- /dev/null +++ b/frontend/404.html @@ -0,0 +1,21 @@ + + +
+ ++ Sorry, we couldn’t find the page you’re looking for. +
+ + ← Back to home + + + diff --git a/frontend/index.html b/frontend/index.html index b22c3d7d..444e61d4 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,45 +1,78 @@ -- Drag & drop a file here, or click to select a file. -
- -+ Drag & drop a file here, or click to select a file. +
+ +