feat(presentation): GET /health endpoint

This commit is contained in:
2026-05-14 11:21:58 +02:00
parent 6082766935
commit 2524440fe4
3 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
use axum::{extract::State, Json};
use crate::state::AppState;
pub async fn health_handler(State(s): State<AppState>) -> Json<serde_json::Value> {
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" },
}))
}