Really-amin commited on
Commit
f5d1d48
·
verified ·
1 Parent(s): 9ba0006

Fix healthcheck: add /api/health alias

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -580,6 +580,18 @@ async def health():
580
  "websocket_connections": len(manager.active_connections)
581
  }
582
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  @app.get("/api/resources/stats")
584
  async def resources_stats():
585
  """آمار منابع"""
 
580
  "websocket_connections": len(manager.active_connections)
581
  }
582
 
583
+ # HF Space/Docker healthcheck + frontend compatibility
584
+ @app.get("/api/health")
585
+ async def api_health():
586
+ """Health check (alias for /health)"""
587
+ return {
588
+ "status": "healthy",
589
+ "timestamp": datetime.now().isoformat(),
590
+ "resources_loaded": len(RESOURCES) > 0,
591
+ "total_categories": len([k for k, v in RESOURCES.items() if isinstance(v, list)]),
592
+ "websocket_connections": len(manager.active_connections)
593
+ }
594
+
595
  @app.get("/api/resources/stats")
596
  async def resources_stats():
597
  """آمار منابع"""