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

41 lines
761 B
Rust
Raw Normal View History

2020-12-12 13:32:06 +01:00
use actix_web::{get, HttpResponse};
use serde::{Deserialize, Serialize};
pub mod document;
pub mod health;
pub mod index;
pub mod key;
pub mod search;
2021-01-01 16:59:49 +01:00
pub mod settings;
2020-12-12 13:32:06 +01:00
pub mod stats;
pub mod synonym;
2021-05-05 14:11:56 +02:00
pub mod dump;
2020-12-12 13:32:06 +01:00
#[derive(Deserialize)]
pub struct IndexParam {
2020-12-23 16:12:37 +01:00
index_uid: String,
2020-12-12 13:32:06 +01:00
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct IndexUpdateResponse {
pub update_id: u64,
}
impl IndexUpdateResponse {
pub fn with_id(update_id: u64) -> Self {
Self { update_id }
}
}
2021-03-19 11:34:54 +01:00
/// Always return a 200 with:
/// ```json
/// {
/// "status": "Meilisearch is running"
/// }
/// ```
#[get("/")]
pub async fn running() -> HttpResponse {
HttpResponse::Ok().json(serde_json::json!({ "status": "MeiliSearch is running" }))
}