fixed fallback route

parent 75409e57
Showing with 3 additions and 4 deletions
......@@ -11,6 +11,7 @@ from book.schemas import Book # Import Book schema
from auth import is_admin_user, is_valid_user
from fastapi.staticfiles import StaticFiles
from fastapi.responses import RedirectResponse
from fastapi import Request
from config import config
app = FastAPI()
......@@ -108,6 +109,6 @@ def login(form_data: OAuth2PasswordRequestForm = Depends(), db: Session = Depend
# Redirect root URL to the public index.html
@app.route("/{full_path:path}")
async def catch_all(full_path: str):
async def catch_all(request: Request, full_path: str):
print("full_path: " + full_path)
return RedirectResponse("/public/index.html")
\ No newline at end of file
#!/bin/bash
# Copy React build to FastAPI public directory
cp -r react/out/* fastapi/public/
# Copy production config to FastAPI config
cp fastapi/config-prod.py fastapi/config.py
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment