Spaces:
Sleeping
Sleeping
Update backend/main.py
Browse files- backend/main.py +5 -1
backend/main.py
CHANGED
|
@@ -25,13 +25,17 @@ from fastapi.staticfiles import StaticFiles
|
|
| 25 |
from fastapi.responses import FileResponse
|
| 26 |
import pathlib
|
| 27 |
|
| 28 |
-
_static_dir = pathlib.Path(__file__).parent / "static"
|
| 29 |
if _static_dir.exists():
|
| 30 |
app.mount("/assets", StaticFiles(directory=str(_static_dir / "assets")), name="assets")
|
| 31 |
|
| 32 |
@app.get("/")
|
| 33 |
async def serve_index():
|
| 34 |
return FileResponse(str(_static_dir / "index.html"))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
# ββ Config ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 37 |
GROQ_MODEL = "llama-3.3-70b-versatile"
|
|
|
|
| 25 |
from fastapi.responses import FileResponse
|
| 26 |
import pathlib
|
| 27 |
|
| 28 |
+
_static_dir = pathlib.Path(__file__).parent.parent / "backend" / "static"
|
| 29 |
if _static_dir.exists():
|
| 30 |
app.mount("/assets", StaticFiles(directory=str(_static_dir / "assets")), name="assets")
|
| 31 |
|
| 32 |
@app.get("/")
|
| 33 |
async def serve_index():
|
| 34 |
return FileResponse(str(_static_dir / "index.html"))
|
| 35 |
+
else:
|
| 36 |
+
@app.get("/")
|
| 37 |
+
async def serve_fallback():
|
| 38 |
+
return {"status": "running", "message": "static dir not found at: " + str(_static_dir)}
|
| 39 |
|
| 40 |
# ββ Config ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 41 |
GROQ_MODEL = "llama-3.3-70b-versatile"
|