mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
Merge #1755
1755: Fix mini dashboard r=curquiza a=anirudhRowjee This commit is a fix to issue #1750. As a part of the changes to solve this issue, the following changes have been made - 1. Route registration for static assets has been modified 2. the `mut` keyword on the `scope` has been removed. Co-authored-by: Anirudh Rowjee <ani.rowjee@gmail.com>
This commit is contained in:
commit
607e28749a
@ -147,7 +147,6 @@ pub fn dashboard(config: &mut web::ServiceConfig, enable_frontend: bool) {
|
|||||||
|
|
||||||
if enable_frontend {
|
if enable_frontend {
|
||||||
let generated = generated::generate();
|
let generated = generated::generate();
|
||||||
let mut scope = web::scope("/");
|
|
||||||
// Generate routes for mini-dashboard assets
|
// Generate routes for mini-dashboard assets
|
||||||
for (path, resource) in generated.into_iter() {
|
for (path, resource) in generated.into_iter() {
|
||||||
let Resource {
|
let Resource {
|
||||||
@ -159,12 +158,11 @@ pub fn dashboard(config: &mut web::ServiceConfig, enable_frontend: bool) {
|
|||||||
web::get().to(move || HttpResponse::Ok().content_type(mime_type).body(data)),
|
web::get().to(move || HttpResponse::Ok().content_type(mime_type).body(data)),
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
scope = scope.service(web::resource(path).route(
|
config.service(web::resource(path).route(
|
||||||
web::get().to(move || HttpResponse::Ok().content_type(mime_type).body(data)),
|
web::get().to(move || HttpResponse::Ok().content_type(mime_type).body(data)),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
config.service(scope);
|
|
||||||
} else {
|
} else {
|
||||||
config.service(web::resource("/").route(web::get().to(routes::running)));
|
config.service(web::resource("/").route(web::get().to(routes::running)));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user