diff --git a/meilisearch-http/src/lib.rs b/meilisearch-http/src/lib.rs index b5f35f277..12a2f85a8 100644 --- a/meilisearch-http/src/lib.rs +++ b/meilisearch-http/src/lib.rs @@ -63,6 +63,7 @@ pub fn create_app( .service(routes::load_css) } else { app + .service(routes::running) } } diff --git a/meilisearch-http/src/routes/mod.rs b/meilisearch-http/src/routes/mod.rs index 15a858055..e2aeb8171 100644 --- a/meilisearch-http/src/routes/mod.rs +++ b/meilisearch-http/src/routes/mod.rs @@ -29,6 +29,7 @@ impl IndexUpdateResponse { } } +/// Return the dashboard, should not be used in production. See [running] #[get("/")] pub async fn load_html() -> HttpResponse { HttpResponse::Ok() @@ -36,6 +37,17 @@ pub async fn load_html() -> HttpResponse { .body(include_str!("../../public/interface.html").to_string()) } +/// Always return a 200 with: +/// ```json +/// { +/// "status": "Meilisearch is running" +/// } +/// ``` +#[get("/")] +pub async fn running() -> HttpResponse { + HttpResponse::Ok().json(serde_json::json!({ "status": "MeiliSearch is running" })) +} + #[get("/bulma.min.css")] pub async fn load_css() -> HttpResponse { HttpResponse::Ok()