Fix static file serving for favicon and other dist root files

This commit is contained in:
Mondo Diaz
2026-01-15 18:36:17 +00:00
parent 8549956a5e
commit 7c20cf9cdf

View File

@@ -88,6 +88,11 @@ if os.path.exists(static_dir):
raise HTTPException(status_code=404, detail="Not found")
# Check if requesting a static file from dist root (favicon, etc.)
static_file_path = os.path.join(static_dir, full_path)
if os.path.isfile(static_file_path) and not full_path.startswith("."):
return FileResponse(static_file_path)
# Serve SPA for all other routes (including /project/*)
index_path = os.path.join(static_dir, "index.html")
if os.path.exists(index_path):