use json instead of body when crafting the request

This commit is contained in:
tamo 2021-03-16 17:45:59 +01:00
parent a268d0e283
commit 233c1e304d
No known key found for this signature in database
GPG Key ID: 7A6A970C96104F1B

View File

@ -9,6 +9,5 @@ pub fn services(cfg: &mut web::ServiceConfig) {
#[get("/health")]
async fn get_health() -> Result<HttpResponse, ResponseError> {
let payload = serde_json::json!({ "status": "available" });
Ok(HttpResponse::Ok().body(payload.to_string()))
Ok(HttpResponse::Ok().json(serde_json::json!({ "status": "available" })))
}