diff --git a/build/azure-pipeline/workflow-pr.yml b/build/azure-pipeline/workflow-pr.yml index 6c243e7..e15c0ec 100644 --- a/build/azure-pipeline/workflow-pr.yml +++ b/build/azure-pipeline/workflow-pr.yml @@ -17,6 +17,8 @@ pr: - divoom/Cargo.toml - divoom_cli/src - divoom_cli/Cargo.toml + - divoom_gateway/src + - divoom_gateway/Cargo.toml # # Version and jobs diff --git a/divoom_gateway/src/server/api_server.rs b/divoom_gateway/src/server/api_server.rs index dbb55d7..eb1a310 100644 --- a/divoom_gateway/src/server/api_server.rs +++ b/divoom_gateway/src/server/api_server.rs @@ -1,6 +1,6 @@ use super::api_handler::*; use divoom::DivoomAnimationTemplateManager; -use poem::{listener::TcpListener, Route}; +use poem::{listener::TcpListener, Route, handler}; use poem_openapi::OpenApiService; use std::sync::Arc; @@ -45,10 +45,16 @@ impl ApiServer { let app = Route::new() .nest("/api", api_service) .nest("/openapi.json", spec) - .nest("/", ui); + .nest("/", ui) + .at("/probe", poem::get(probe)); let server_endpoint = format!("{}:{}", self.server_address, self.server_port); let server_listener = TcpListener::bind(server_endpoint); poem::Server::new(server_listener).run(app).await } } + +#[handler] +fn probe() -> String { + "ok".to_string() +}