Metar overhaul, added footer, updated schemas
This commit is contained in:
@@ -12,23 +12,16 @@ pub struct SystemInfo {
|
||||
}
|
||||
|
||||
#[utoipa::path(
|
||||
tag = "System",
|
||||
tag = "system",
|
||||
responses(
|
||||
(status = 200, description = "Successful system info"),
|
||||
)
|
||||
)]
|
||||
#[get("/info")]
|
||||
async fn info() -> HttpResponse {
|
||||
let mut healthy = true;
|
||||
let version = match env::var("CARGO_PKG_VERSION") {
|
||||
Ok(v) => v,
|
||||
Err(_) => {
|
||||
healthy = false;
|
||||
String::from("unknown")
|
||||
}
|
||||
};
|
||||
|
||||
let info = SystemInfo { version, healthy };
|
||||
let healthy = true;
|
||||
let version = env!("CARGO_PKG_VERSION");
|
||||
let info = SystemInfo { version: version.to_string(), healthy };
|
||||
|
||||
HttpResponse::Ok().json(info)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user