diff --git a/crates/server/src/main.rs b/crates/server/src/main.rs index a8755fd..b457f13 100644 --- a/crates/server/src/main.rs +++ b/crates/server/src/main.rs @@ -6,7 +6,7 @@ use axum::{ extract::{ContentLengthLimit, Extension}, http::{header, StatusCode}, response::{IntoResponse, Response}, - routing::{get_service, post}, + routing::{get, get_service, post}, Router, }; use sentry::integrations::tower::{NewSentryLayer, SentryHttpLayer}; @@ -100,6 +100,7 @@ async fn main() { // Build our application by composing routes let app = Router::new() .route("/search", post(search)) + .route("/health", get(health)) //.route("/gather", post(gather)) .fallback(get_service(ServeDir::new(opts.assets)).handle_error(handle_static_serve_error)) // Add middleware to all routes @@ -213,6 +214,10 @@ async fn search( } } +async fn health() -> Response { + (StatusCode::OK, "I'm doing science and I'm still alive").into_response() +} + async fn handle_static_serve_error(error: std::io::Error) -> impl IntoResponse { ( StatusCode::INTERNAL_SERVER_ERROR,