use json instead of body when crafting the request
@@ -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" })))
}
