mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
fix root route
This commit is contained in:
parent
1640d9ea91
commit
7ecefe37da
@ -44,7 +44,7 @@ macro_rules! create_app {
|
|||||||
let app = if $enable_frontend {
|
let app = if $enable_frontend {
|
||||||
app.service(load_html).service(load_css)
|
app.service(load_html).service(load_css)
|
||||||
} else {
|
} else {
|
||||||
app
|
app.service(running)
|
||||||
};
|
};
|
||||||
app.wrap(
|
app.wrap(
|
||||||
Cors::default()
|
Cors::default()
|
||||||
|
@ -29,6 +29,7 @@ impl IndexUpdateResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return the dashboard, should not be used in production. See [running]
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
pub async fn load_html() -> HttpResponse {
|
pub async fn load_html() -> HttpResponse {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
@ -36,6 +37,17 @@ pub async fn load_html() -> HttpResponse {
|
|||||||
.body(include_str!("../../public/interface.html").to_string())
|
.body(include_str!("../../public/interface.html").to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 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" }))
|
||||||
|
}
|
||||||
|
|
||||||
#[get("/bulma.min.css")]
|
#[get("/bulma.min.css")]
|
||||||
pub async fn load_css() -> HttpResponse {
|
pub async fn load_css() -> HttpResponse {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
|
Loading…
Reference in New Issue
Block a user