2020-10-19 07:39:06 +02:00
|
|
|
use actix_web::get;
|
2020-04-22 17:43:51 +02:00
|
|
|
use actix_web::{web, HttpResponse};
|
2019-10-31 15:00:36 +01:00
|
|
|
|
2020-10-19 07:39:06 +02:00
|
|
|
use crate::error::ResponseError;
|
2020-04-22 17:43:51 +02:00
|
|
|
|
|
|
|
pub fn services(cfg: &mut web::ServiceConfig) {
|
2020-10-19 07:39:06 +02:00
|
|
|
cfg.service(get_health);
|
2020-04-22 17:43:51 +02:00
|
|
|
}
|
|
|
|
|
2020-07-01 15:45:24 +02:00
|
|
|
#[get("/health")]
|
2020-10-19 07:39:06 +02:00
|
|
|
async fn get_health() -> Result<HttpResponse, ResponseError> {
|
2021-03-16 14:02:14 +01:00
|
|
|
let payload = serde_json::json!({ "status": "available" });
|
2021-03-18 11:54:10 +01:00
|
|
|
Ok(HttpResponse::Ok().json(payload))
|
2019-10-31 15:00:36 +01:00
|
|
|
}
|