import routes modules in main

This commit is contained in:
mpostma 2021-03-06 10:53:11 +01:00
parent 7d28f8cff0
commit 86211b1ddd
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A

View File

@ -83,18 +83,20 @@ async fn main() -> Result<(), MainError> {
}
async fn run_http(data: Data, opt: Opt, enable_frontend: bool) -> Result<(), Box<dyn std::error::Error>> {
use meilisearch::routes::*;
let http_server = HttpServer::new(move || {
let app = App::new()
.configure(|c| configure_data(c, &data))
.configure(meilisearch::routes::document::services)
.configure(meilisearch::routes::index::services)
.configure(meilisearch::routes::search::services)
.configure(meilisearch::routes::settings::services)
.configure(meilisearch::routes::stop_words::services)
.configure(meilisearch::routes::synonym::services)
.configure(meilisearch::routes::health::services)
.configure(meilisearch::routes::stats::services)
.configure(meilisearch::routes::key::services);
.configure(document::services)
.configure(index::services)
.configure(search::services)
.configure(settings::services)
.configure(stop_words::services)
.configure(synonym::services)
.configure(health::services)
.configure(stats::services)
.configure(key::services);
//.configure(routes::dump::services);
let app = if enable_frontend {
app