Spaces:
Sleeping
Sleeping
Claude Code Claude Opus 4.6 commited on
Commit ·
b8f337d
1
Parent(s): 1550d6c
Claude Code: Fix frontend mount - use absolute path /app/frontend with root mount and html=True
Browse files
app.py
CHANGED
|
@@ -97,7 +97,12 @@ class LoggingMiddleware(BaseHTTPMiddleware):
|
|
| 97 |
app.add_middleware(LoggingMiddleware)
|
| 98 |
|
| 99 |
# Mount static files for frontend
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
|
| 103 |
@app.exception_handler(Exception)
|
|
|
|
| 97 |
app.add_middleware(LoggingMiddleware)
|
| 98 |
|
| 99 |
# Mount static files for frontend
|
| 100 |
+
frontend_dir = "/app/frontend"
|
| 101 |
+
if os.path.exists(frontend_dir):
|
| 102 |
+
app.mount("/", StaticFiles(directory=frontend_dir, html=True), name="frontend")
|
| 103 |
+
print(f"Mounted frontend from {frontend_dir}")
|
| 104 |
+
else:
|
| 105 |
+
print(f"ERROR: Frontend missing at {frontend_dir}")
|
| 106 |
|
| 107 |
|
| 108 |
@app.exception_handler(Exception)
|