From bfe65d23ff914d55f6ee049de6dc9aafd2d7a422 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Sun, 8 Feb 2026 15:37:35 +0000 Subject: [PATCH] feat: add /health endpoint for Fly.io health checks - Add lightweight GET /health returning {"status":"ok"} - Update fly.toml to use /health instead of / --- fly.toml | 2 +- src/application/routes/app/mod.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fly.toml b/fly.toml index fee7809..f84f043 100644 --- a/fly.toml +++ b/fly.toml @@ -25,7 +25,7 @@ interval = '30s' timeout = '5s' grace_period = '10s' method = 'GET' -path = '/' +path = '/health' [mounts] source = 'brewlog_data' diff --git a/src/application/routes/app/mod.rs b/src/application/routes/app/mod.rs index 5b4348f..344934b 100644 --- a/src/application/routes/app/mod.rs +++ b/src/application/routes/app/mod.rs @@ -39,6 +39,7 @@ pub(super) fn router() -> axum::Router { .route("/components/donut-chart.js", get(donut_chart_js)) .route("/favicon-light.svg", get(favicon_light)) .route("/favicon-dark.svg", get(favicon_dark)) + .route("/health", get(health)) } async fn scan_redirect() -> Redirect { @@ -134,3 +135,10 @@ async fn favicon_dark() -> impl IntoResponse { include_str!("../../../../static/favicon-dark.svg"), ) } + +async fn health() -> impl IntoResponse { + ( + [("content-type", "application/json")], + r#"{"status":"ok"}"#, + ) +}