From 8b7abb87010212791d885339b0163612d8b884bf Mon Sep 17 00:00:00 2001 From: Amin Moghaddam Date: Wed, 14 Feb 2024 10:21:04 +0100 Subject: [PATCH] Add liveness endpoint (#16) --- auction-server/src/api.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/auction-server/src/api.rs b/auction-server/src/api.rs index d077f1cf..b3a5f26d 100644 --- a/auction-server/src/api.rs +++ b/auction-server/src/api.rs @@ -152,6 +152,10 @@ impl IntoResponse for RestError { } } +pub async fn live() -> Response { + (StatusCode::OK, "OK").into_response() +} + pub async fn start_server(run_options: RunOptions) -> Result<()> { tokio::spawn(async move { tracing::info!("Registered shutdown signal handler..."); @@ -254,6 +258,7 @@ pub async fn start_server(run_options: RunOptions) -> Result<()> { "/v1/liquidation/opportunities/:opportunity_id/bids", post(liquidation::post_bid), ) + .route("/live", get(live)) .layer(CorsLayer::permissive()) .with_state(server_store);