Add health check endpoint
Some checks are pending
Build docker image / Build-Docker-Image (push) Waiting to run
rust-clippy analyze / Run rust-clippy analyzing (push) Waiting to run

This commit is contained in:
2026-01-14 15:58:28 +01:00
parent 9c42214c3b
commit c5e27baaee

View File

@@ -99,6 +99,10 @@ async fn download(Path(task_id): Path<String>) -> 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)