from fastapi import APIRouter, HTTPException from app.services.db import health_check router = APIRouter() @router.get("/health") def health(): if not health_check(): raise HTTPException(status_code=503, detail="db_unavailable") return {"status": "ok", "db": "ok"}