use salvo::prelude::*;
use serde::Serialize;
#[handler]
pub async fn health_check(_req: &mut Request, _depot: &mut Depot, res: &mut Response) {
res.render(Json(&HealthResponse {
status: "ok".to_string(),
}));
}
#[handler]
pub async fn status(_req: &mut Request, _depot: &mut Depot, res: &mut Response) {
res.render(Json(&StatusResponse {
status: "running".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
uptime: 0,
}));
}
#[derive(Serialize)]
struct HealthResponse {
status: String,
}
#[derive(Serialize)]
struct StatusResponse {
status: String,
version: String,
uptime: u64,
}