mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
return a 400 on / when meilisearch is running in production
This commit is contained in:
parent
5ca3382f5c
commit
0c27bea135
@ -63,6 +63,7 @@ pub fn create_app(
|
|||||||
.service(routes::load_css)
|
.service(routes::load_css)
|
||||||
} else {
|
} else {
|
||||||
app
|
app
|
||||||
|
.service(routes::running)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ impl IndexUpdateResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return the dashboard, should not be used in production. See [running]
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
pub async fn load_html() -> HttpResponse {
|
pub async fn load_html() -> HttpResponse {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
@ -36,6 +37,18 @@ pub async fn load_html() -> HttpResponse {
|
|||||||
.body(include_str!("../../public/interface.html").to_string())
|
.body(include_str!("../../public/interface.html").to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Always return a 200 with:
|
||||||
|
/// ```json
|
||||||
|
/// {
|
||||||
|
/// "status": "Meilisearch is running"
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
#[get("/")]
|
||||||
|
pub async fn running() -> HttpResponse {
|
||||||
|
let payload = serde_json::json!({ "status": "MeiliSearch is running" }).to_string();
|
||||||
|
HttpResponse::Ok().body(payload)
|
||||||
|
}
|
||||||
|
|
||||||
#[get("/bulma.min.css")]
|
#[get("/bulma.min.css")]
|
||||||
pub async fn load_css() -> HttpResponse {
|
pub async fn load_css() -> HttpResponse {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
|
Loading…
Reference in New Issue
Block a user