mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-05 20:48:58 +01:00
add a body to be fully compliant with the http spec
This commit is contained in:
parent
a2ac2de011
commit
f6d0689967
@ -9,5 +9,6 @@ pub fn services(cfg: &mut web::ServiceConfig) {
|
||||
|
||||
#[get("/health")]
|
||||
async fn get_health() -> Result<HttpResponse, ResponseError> {
|
||||
Ok(HttpResponse::Ok().finish())
|
||||
let payload = serde_json::json!({ "status": "ok" });
|
||||
Ok(HttpResponse::Ok().body(payload.to_string()))
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ async fn test_healthyness() {
|
||||
|
||||
// Check that the server is healthy
|
||||
|
||||
let (_response, status_code) = server.get_health().await;
|
||||
let (response, status_code) = server.get_health().await;
|
||||
assert_eq!(status_code, 200);
|
||||
assert_eq!(response["status"], "ok");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user