fix(server): return version details in health and shutdown endpoints
This commit is contained in:
1 parent
4cb76725fe
commit
cb39f94584
4 files changed
+35
-11
No files matched your search
+10
-2
@@ -104,8 +104,16 @@ pub async fn gate_set_handler(
|
||||
Ok((axum::http::StatusCode::OK, "Gate state updated."))
|
||||
}
|
||||
|
||||
pub async fn health_handler() -> &'static str {
|
||||
"OK"
|
||||
pub async fn health_handler() -> impl IntoResponse {
|
||||
axum::Json(serde_json::json!({
|
||||
"status": "ok",
|
||||
"version": {
|
||||
"app_version": env!("APP_VERSION"),
|
||||
"cargo_pkg_version": env!("CARGO_PKG_VERSION"),
|
||||
"target_os": std::env::consts::OS,
|
||||
"target_arch": std::env::consts::ARCH,
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
+11
-1
@@ -143,7 +143,17 @@ pub fn create_router(app_state: Arc<AppState>) -> Router {
|
||||
std::process::exit(0);
|
||||
});
|
||||
|
||||
(axum::http::StatusCode::OK, "Shutting down...").into_response()
|
||||
axum::Json(serde_json::json!({
|
||||
"status": "shutting_down",
|
||||
"message": "MCP Memory Server gracefully shutting down.",
|
||||
"version_details": {
|
||||
"app_version": env!("APP_VERSION"),
|
||||
"cargo_pkg_version": env!("CARGO_PKG_VERSION"),
|
||||
"target_os": std::env::consts::OS,
|
||||
"target_arch": std::env::consts::ARCH,
|
||||
"shutdown_checkpoint": format!("chk_shutdown_{}", now)
|
||||
}
|
||||
})).into_response()
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user