feat: add /health endpoint for Fly.io health checks
- Add lightweight GET /health returning {"status":"ok"}
- Update fly.toml to use /health instead of /
This commit is contained in:
parent
dbdb15a492
commit
bfe65d23ff
2 changed files with 9 additions and 1 deletions
2
fly.toml
2
fly.toml
|
|
@ -25,7 +25,7 @@ interval = '30s'
|
||||||
timeout = '5s'
|
timeout = '5s'
|
||||||
grace_period = '10s'
|
grace_period = '10s'
|
||||||
method = 'GET'
|
method = 'GET'
|
||||||
path = '/'
|
path = '/health'
|
||||||
|
|
||||||
[mounts]
|
[mounts]
|
||||||
source = 'brewlog_data'
|
source = 'brewlog_data'
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ pub(super) fn router() -> axum::Router<AppState> {
|
||||||
.route("/components/donut-chart.js", get(donut_chart_js))
|
.route("/components/donut-chart.js", get(donut_chart_js))
|
||||||
.route("/favicon-light.svg", get(favicon_light))
|
.route("/favicon-light.svg", get(favicon_light))
|
||||||
.route("/favicon-dark.svg", get(favicon_dark))
|
.route("/favicon-dark.svg", get(favicon_dark))
|
||||||
|
.route("/health", get(health))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn scan_redirect() -> Redirect {
|
async fn scan_redirect() -> Redirect {
|
||||||
|
|
@ -134,3 +135,10 @@ async fn favicon_dark() -> impl IntoResponse {
|
||||||
include_str!("../../../../static/favicon-dark.svg"),
|
include_str!("../../../../static/favicon-dark.svg"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn health() -> impl IntoResponse {
|
||||||
|
(
|
||||||
|
[("content-type", "application/json")],
|
||||||
|
r#"{"status":"ok"}"#,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue