Spaces:
Sleeping
Sleeping
Commit ·
7423aa7
1
Parent(s): 1fb8f9c
Add root endpoint for HF Space probes
Browse files- src/server/app.py +12 -0
src/server/app.py
CHANGED
|
@@ -41,6 +41,18 @@ async def runtime_error_handler(request, exc: RuntimeError):
|
|
| 41 |
return JSONResponse(status_code=500, content={"detail": str(exc)})
|
| 42 |
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
@app.get("/health")
|
| 45 |
async def health() -> dict[str, str]:
|
| 46 |
# OpenEnv runtime validation expects status=healthy
|
|
|
|
| 41 |
return JSONResponse(status_code=500, content={"detail": str(exc)})
|
| 42 |
|
| 43 |
|
| 44 |
+
@app.get("/", include_in_schema=False)
|
| 45 |
+
async def root() -> dict[str, Any]:
|
| 46 |
+
"""Root endpoint for Spaces health probes and browser landing."""
|
| 47 |
+
return {
|
| 48 |
+
"status": "healthy",
|
| 49 |
+
"service": "citywide-dispatch-supervisor",
|
| 50 |
+
"health": "/health",
|
| 51 |
+
"tasks": "/tasks",
|
| 52 |
+
"dashboard_state": "/dashboard/state",
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
|
| 56 |
@app.get("/health")
|
| 57 |
async def health() -> dict[str, str]:
|
| 58 |
# OpenEnv runtime validation expects status=healthy
|