ruvector_server/routes/
health.rs1use crate::{state::AppState, Result};
4use axum::{extract::State, response::IntoResponse, Json};
5use serde::Serialize;
6
7#[derive(Debug, Serialize)]
9pub struct HealthStatus {
10 pub status: String,
12}
13
14#[derive(Debug, Serialize)]
16pub struct ReadinessStatus {
17 pub status: String,
19 pub collections: usize,
21 pub total_points: usize,
23}
24
25pub async fn health_check() -> Result<impl IntoResponse> {
29 Ok(Json(HealthStatus {
30 status: "healthy".to_string(),
31 }))
32}
33
34pub async fn readiness(State(state): State<AppState>) -> Result<impl IntoResponse> {
38 let collections_count = state.collection_count();
39
40 Ok(Json(ReadinessStatus {
42 status: "ready".to_string(),
43 collections: collections_count,
44 total_points: 0, }))
46}