Skip to content

Commit 938431d

Browse files
authored
healthz: Add healthz endpoint (#21)
1 parent 1dc8306 commit 938431d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

blade/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ cfg_if! {
243243
.service(Files::new("/assets", assets.clone()))
244244
// serve the favicon from /favicon.ico
245245
.service(favicon)
246+
.service(healthz)
246247
.leptos_routes_with_context(
247248
routes,
248249
move|| provide_context(rt_state.clone()),
@@ -291,6 +292,11 @@ cfg_if! {
291292
Ok(actix_files::NamedFile::open(r.rlocation("_main/blade/static/static/favicon.ico").unwrap())?)
292293
}
293294

295+
#[get("/healthz")]
296+
async fn healthz() -> HttpResponse {
297+
HttpResponse::Ok().body("OK")
298+
}
299+
294300
#[instrument]
295301
async fn periodic_cleanup(global: Arc<state::Global>) {
296302
let day = std::time::Duration::from_secs(60 * 60 * 24);

0 commit comments

Comments
 (0)