use axum::{response::IntoResponse, Json}; use axum_extra::routing::TypedPath; use serde::Deserialize; #[derive(Debug, Deserialize, TypedPath)] #[typed_path("/api/healthcheck")] pub struct HealthCheck; impl HealthCheck { #[tracing::instrument] pub async fn get(self) -> impl IntoResponse { const MESSAGE: &str = "Unnamed server"; let json_response = serde_json::json!({ "status": "success", "message": MESSAGE }); Json(json_response) } }