Skip to content

Commit

Permalink
fix: Add healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
philipcristiano committed Jul 12, 2024
1 parent 6e9ec21 commit 155dd5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ async fn main() {
.with_state(app_state.auth.clone())
.layer(CookieManagerLayer::new())
.layer(
service_conventions::tracing_http::trace_layer(Level::INFO)
);
service_conventions::tracing_http::trace_layer(Level::INFO))
.route("/_health", get(health))
;

let addr: SocketAddr = args.bind_addr.parse().expect("Expected bind addr");
tracing::info!("listening on {}", addr);
Expand All @@ -92,6 +93,10 @@ async fn root() -> Response {
.into_response()
}

async fn health() -> Response {
"OK".into_response()
}

async fn user_handler(user: Option<service_conventions::oidc::OIDCUser>) -> Response {
if let Some(user) = user {
html! {
Expand Down

0 comments on commit 155dd5f

Please sign in to comment.