feat: basic
Some checks failed
CI / Rust Check (push) Has been cancelled
CI / Web UI Check (push) Has been cancelled
CI / Security Audit (push) Has been cancelled

This commit is contained in:
2025-07-12 23:59:42 +08:00
parent c7fe5373e1
commit dd11bc70b5
44 changed files with 9164 additions and 1 deletions

19
src/api/health.rs Normal file
View File

@@ -0,0 +1,19 @@
//! Health check endpoint
//!
//! This module provides the health check API endpoint.
use axum::Json;
use crate::types::HealthResponse;
/// Health check handler
pub async fn health_check() -> Json<HealthResponse> {
static START_TIME: std::sync::OnceLock<std::time::Instant> = std::sync::OnceLock::new();
let start = START_TIME.get_or_init(std::time::Instant::now);
Json(HealthResponse {
status: "ok".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
uptime_seconds: start.elapsed().as_secs(),
})
}