Skip to main content

objectstore_server/endpoints/
health.rs

1//! Health and readiness endpoints.
2//!
3//! Exposes `/health` (liveness) and `/ready` (readiness). Both currently return
4//! 200 `OK`, including during shutdown. Pod termination triggers endpoint removal;
5//! the preStop hook keeps the server available while routing updates propagate.
6
7use axum::response::IntoResponse;
8use axum::{Router, routing};
9
10use crate::state::ServiceState;
11
12/// Returns a router with the `/health` and `/ready` endpoints.
13pub fn router() -> Router<ServiceState> {
14    Router::new()
15        .route("/health", routing::get(health))
16        .route("/ready", routing::get(ready))
17}
18
19async fn health() -> impl IntoResponse {
20    "OK"
21}
22
23async fn ready() -> impl IntoResponse {
24    "OK"
25}