Upload folder using huggingface_hub
Browse files- backend/main.py +3 -2
backend/main.py
CHANGED
|
@@ -127,10 +127,11 @@ async def serve_react_app(full_path: str):
|
|
| 127 |
static_dir = Path(__file__).parent / "static"
|
| 128 |
index_file = static_dir / "index.html"
|
| 129 |
|
| 130 |
-
#
|
| 131 |
-
if full_path.startswith(('api', '
|
| 132 |
raise HTTPException(status_code=404, detail="API endpoint not found")
|
| 133 |
|
|
|
|
| 134 |
if index_file.exists():
|
| 135 |
return FileResponse(index_file)
|
| 136 |
else:
|
|
|
|
| 127 |
static_dir = Path(__file__).parent / "static"
|
| 128 |
index_file = static_dir / "index.html"
|
| 129 |
|
| 130 |
+
# Check if this is an API route or static file
|
| 131 |
+
if (full_path.startswith(('api', 'health', 'analyze', 'status', 'results', 'supported-models', 'compliance-status', 'assets'))):
|
| 132 |
raise HTTPException(status_code=404, detail="API endpoint not found")
|
| 133 |
|
| 134 |
+
# Serve React app for everything else (client-side routing)
|
| 135 |
if index_file.exists():
|
| 136 |
return FileResponse(index_file)
|
| 137 |
else:
|