24 lines
565 B
Python
24 lines
565 B
Python
"""Health check endpoints."""
|
|
from fastapi import APIRouter
|
|
from app.core.database import DatabaseService
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/health-check")
|
|
async def health_check() -> dict[str, str]:
|
|
"""Comprehensive health check endpoint."""
|
|
|
|
# Check database connectivity
|
|
db_healthy = DatabaseService.health_check()
|
|
|
|
status = "healthy" if db_healthy else "unhealthy"
|
|
|
|
result = {
|
|
"status": status,
|
|
"service": "loapi",
|
|
"database": "connected" if db_healthy else "disconnected"
|
|
}
|
|
|
|
return result
|