DEBUG observability: router properly mounted before root() handler

This commit is contained in:
2026-05-05 08:47:10 +02:00
parent 63ca005b6e
commit 52db3d91a4
+9
View File
@@ -1796,6 +1796,15 @@ _UPLOAD_DIR.mkdir(parents=True, exist_ok=True)
(_UPLOAD_DIR / "avatars").mkdir(parents=True, exist_ok=True)
app.mount("/uploads", StaticFiles(directory=str(_UPLOAD_DIR)), name="uploads")
# === DEBUG observability router (live dashboard) ===
try:
from routers.debug_router import router as debug_router
app.include_router(debug_router)
print('[DEBUG] observability router loaded (/api/debug/*)')
except Exception as e:
print(f'[DEBUG] router fail: {e}')
@app.get("/")
def root(request: Request):
host = request.headers.get("host", "")