Fix healthcheck: add /api/health alias
Browse files
app.py
CHANGED
|
@@ -572,6 +572,18 @@ async def health():
|
|
| 572 |
"websocket_connections": len(manager.active_connections)
|
| 573 |
}
|
| 574 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 575 |
@app.get("/api/resources/stats")
|
| 576 |
async def resources_stats():
|
| 577 |
"""آمار منابع"""
|
|
|
|
| 572 |
"websocket_connections": len(manager.active_connections)
|
| 573 |
}
|
| 574 |
|
| 575 |
+
# HF Space/Docker healthcheck + frontend compatibility
|
| 576 |
+
@app.get("/api/health")
|
| 577 |
+
async def api_health():
|
| 578 |
+
"""Health check (alias for /health)"""
|
| 579 |
+
return {
|
| 580 |
+
"status": "healthy",
|
| 581 |
+
"timestamp": datetime.now().isoformat(),
|
| 582 |
+
"resources_loaded": len(RESOURCES) > 0,
|
| 583 |
+
"total_categories": len([k for k, v in RESOURCES.items() if isinstance(v, list)]),
|
| 584 |
+
"websocket_connections": len(manager.active_connections)
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
@app.get("/api/resources/stats")
|
| 588 |
async def resources_stats():
|
| 589 |
"""آمار منابع"""
|