aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-server/src/handlers
diff options
context:
space:
mode:
authorHunter Casten <41604962+enchantednatures@users.noreply.github.com>2025-03-09 15:43:27 -0600
committerGitHub <noreply@github.com>2025-03-09 21:43:27 +0000
commit544f3370da3bc72a2b5238c5875f247778d014d4 (patch)
treebc8b91c6ac5c5296a6b18c38519545dd9777ee57 /crates/atuin-server/src/handlers
parentfix: up binding with fish 4.0 (#2613) (#2616) (diff)
downloadatuin-544f3370da3bc72a2b5238c5875f247778d014d4.zip
feat(health): add health check endpoint at `/healthz` (#2549)
* feat(health): add health check endpoint at `/healthz` * feat(health-check): remove invalid health-check from docker compose
Diffstat (limited to 'crates/atuin-server/src/handlers')
-rw-r--r--crates/atuin-server/src/handlers/health.rs15
-rw-r--r--crates/atuin-server/src/handlers/mod.rs1
2 files changed, 16 insertions, 0 deletions
diff --git a/crates/atuin-server/src/handlers/health.rs b/crates/atuin-server/src/handlers/health.rs
new file mode 100644
index 00000000..1a3fc4d7
--- /dev/null
+++ b/crates/atuin-server/src/handlers/health.rs
@@ -0,0 +1,15 @@
+use axum::{http, response::IntoResponse, Json};
+
+use serde::Serialize;
+
+#[derive(Serialize)]
+pub struct HealthResponse {
+ pub status: &'static str,
+}
+
+pub async fn health_check() -> impl IntoResponse {
+ (
+ http::StatusCode::OK,
+ Json(HealthResponse { status: "healthy" }),
+ )
+}
diff --git a/crates/atuin-server/src/handlers/mod.rs b/crates/atuin-server/src/handlers/mod.rs
index ce10f4b7..97132c07 100644
--- a/crates/atuin-server/src/handlers/mod.rs
+++ b/crates/atuin-server/src/handlers/mod.rs
@@ -4,6 +4,7 @@ use axum::{extract::State, http, response::IntoResponse, Json};
use crate::router::AppState;
+pub mod health;
pub mod history;
pub mod record;
pub mod status;