Spaces:
Sleeping
Sleeping
| """Health check endpoints.""" | |
| from fastapi import APIRouter, HTTPException | |
| from src.config.versions import get_all_versions | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| router = APIRouter(prefix="/health", tags=["health"]) | |
| async def health_check(): | |
| """Simple health check endpoint.""" | |
| return { | |
| "status": "ok", | |
| "service": "grant-analyst" | |
| } | |
| async def health_check_detailed(): | |
| """Detailed health check with version info.""" | |
| try: | |
| versions = get_all_versions() | |
| return { | |
| "status": "ok", | |
| "service": "grant-analyst", | |
| "versions": versions | |
| } | |
| except Exception as e: | |
| logger.error(f"Health check failed: {e}") | |
| raise HTTPException(status_code=503, detail="Service unavailable") | |