pub mod access; pub mod agents; pub mod auth; pub mod auth_profiles; pub mod capabilities; pub mod imports; pub mod observability; pub mod operations; pub mod secrets; pub mod upstreams; pub mod workspaces; use axum::{Json, extract::State, http::StatusCode, response::IntoResponse}; use serde_json::json; use crate::state::AppState; pub async fn health() -> Json { Json(json!({ "service": "admin-api", "status": "ok" })) } pub async fn readiness(State(state): State) -> impl IntoResponse { match state.service.readiness().await { Ok(()) => ( StatusCode::OK, Json(json!({ "service": "admin-api", "status": "ready", "checks": { "postgres": "ready" } })), ), Err(error) => ( StatusCode::SERVICE_UNAVAILABLE, Json(json!({ "service": "admin-api", "status": "not_ready", "checks": { "postgres": "not_ready" }, "error": error.to_string() })), ), } }