821537186e
- Reorganized import statements in adapter tests for better readability - Replaced or_insert_with(Vec::new) with or_default() in test closures - Updated Cargo.lock with new dependency versions and checksums - Added TLS features to tonic dependency configuration - Included sqlx, chrono, and uuid dependencies with specific features - Added jsonwebtoken and arc-swap as project dependencies - Reformatted assertion statements to comply with line length limits - Adjusted base64 import order in engine codec module - Updated protobuf include statement formatting
27 lines
676 B
Rust
27 lines
676 B
Rust
//! Health check endpoint for the imks server.
|
|
//!
|
|
//! Returns JSON with server status, version, and upstream connectivity.
|
|
|
|
use actix_web::HttpResponse;
|
|
use serde::Serialize;
|
|
|
|
#[derive(Serialize)]
|
|
struct HealthResponse {
|
|
status: String,
|
|
version: String,
|
|
timestamp: String,
|
|
uptime_secs: u64,
|
|
sessions_count: usize,
|
|
}
|
|
|
|
/// GET /health — returns server health status.
|
|
pub async fn health_check() -> HttpResponse {
|
|
HttpResponse::Ok().json(HealthResponse {
|
|
status: "healthy".into(),
|
|
version: env!("CARGO_PKG_VERSION").into(),
|
|
timestamp: chrono::Utc::now().to_rfc3339(),
|
|
uptime_secs: 0,
|
|
sessions_count: 0,
|
|
})
|
|
}
|