from typing import Dict from fastapi import APIRouter, Depends from sqlalchemy.orm import Session from app.api import deps router = APIRouter(prefix="/health", tags=["health"]) @router.get("", response_model=Dict[str, str]) def health_check(db: Session = Depends(deps.get_db)) -> Dict[str, str]: """ Health check endpoint. """ try: # Try to execute a simple query to check database connection db.execute("SELECT 1") db_status = "healthy" except Exception: db_status = "unhealthy" return { "status": "healthy", "database": db_status }