From c5e27baaee4712988fd4b6597b80c5609943f1d6 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Wed, 14 Jan 2026 15:58:28 +0100 Subject: [PATCH] Add health check endpoint --- src/views.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views.rs b/src/views.rs index 61b863c..65c4a9b 100644 --- a/src/views.rs +++ b/src/views.rs @@ -99,6 +99,10 @@ async fn download(Path(task_id): Path) -> impl IntoResponse { Body::from_stream(stream).into_response() } +async fn health_check() -> impl IntoResponse { + StatusCode::OK +} + pub async fn get_router() -> Router { let (prometheus_layer, metric_handle) = PrometheusMetricLayer::pair(); @@ -114,7 +118,9 @@ pub async fn get_router() -> Router { let metric_router = Router::new().route("/metrics", get(|| async move { metric_handle.render() })); - let public_router = Router::new().route("/api/download/{task_id}", get(download)); + let public_router = Router::new() + .route("/api/download/{task_id}", get(download)) + .route("/health", get(health_check)); Router::new() .merge(public_router)