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)]
|
||||
|
||||
Reference in new issue
Block a user