MeiliSearch/meilisearch-http/src/routes/health.rs

15 lines
371 B
Rust
Raw Normal View History

2020-12-12 13:32:06 +01:00
use actix_web::get;
use actix_web::{web, HttpResponse};
use crate::error::ResponseError;
pub fn services(cfg: &mut web::ServiceConfig) {
cfg.service(get_health);
}
#[get("/health")]
async fn get_health() -> Result<HttpResponse, ResponseError> {
2021-03-16 17:42:01 +01:00
let payload = serde_json::json!({ "status": "available" });
Ok(HttpResponse::Ok().body(payload.to_string()))
2020-12-12 13:32:06 +01:00
}