use axum::{extract::State, Json}; use crate::state::AppState; #[utoipa::path(get, path = "/health", responses((status = 200, description = "Service health status")))] pub async fn health_handler(State(s): State) -> Json { let db_ok = s.users.list_with_stats().await.is_ok(); Json(serde_json::json!({ "status": if db_ok { "ok" } else { "degraded" }, "db": if db_ok { "connected" } else { "error" }, })) }