Skip to content

Commit

Permalink
expose version info over port 80
Browse files Browse the repository at this point in the history
  • Loading branch information
svenrademakers committed Sep 15, 2023
1 parent da977da commit ad360f3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions bmcd/src/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ pub fn config(cfg: &mut web::ServiceConfig) {
)
.route(web::post().guard(fn_guard(flash_guard)).to(handle_chunk))
.route(web::get().to(api_entry)),
)
.service(info_handler);
);
}

pub fn info_config(cfg: &mut web::ServiceConfig) {
Expand All @@ -52,11 +51,7 @@ fn flash_guard(context: &GuardContext<'_>) -> bool {

#[get("/api/bmc/info")]
async fn info_handler() -> impl Responder {
let value = json! {
{ "version" : API_VERSION }
};

LegacyResponse::ok(value)
get_system_information().await.into()
}

async fn api_entry(bmc: web::Data<BmcApplication>, query: Query) -> impl Responder {
Expand Down Expand Up @@ -167,6 +162,7 @@ async fn get_system_information() -> impl Into<LegacyResponse> {

json!(
[{
"api": API_VERSION,
"version": version,
"buildtime": build_time,
"ip": ipv4,
Expand Down

0 comments on commit ad360f3

Please sign in to comment.