summaryrefslogtreecommitdiff
path: root/src/health.rs
blob: c3ae80aff008c5a4cba2cfa92021a05c4eb69d2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use axum::{Json, response::IntoResponse};
use serde_json::json;

#[utoipa::path(
    get,
    path = "/health",
    responses(
        (status = 200, description = "Health check", body = inline(HealthResponse))
    ),
    tag = "health"
)]
pub async fn health_handler() -> impl IntoResponse {
    Json(json!({"status": "ok"}))
}

#[derive(utoipa::ToSchema, serde::Serialize)]
pub struct HealthResponse {
    pub status: String,
}