mirror of
https://github.com/clowzed/sero
synced 2024-05-23 01:32:13 +02:00
Changed cors layer location
This commit is contained in:
parent
2ba76400c4
commit
246730d5c6
11
src/main.rs
11
src/main.rs
|
@ -62,9 +62,10 @@ async fn main() {
|
|||
|
||||
let cloned_state = state.clone();
|
||||
|
||||
let files_router = Router::new()
|
||||
let mut app = Router::new()
|
||||
.nest("/api", api_router)
|
||||
.route("/*path", get(handlers::sites::file))
|
||||
.route("/", get(handlers::sites::index_redirect))
|
||||
.route("/", get(handlers::sites::index_redirect))
|
||||
.layer(
|
||||
CorsLayer::new()
|
||||
.allow_methods(AllowMethods::exact(Method::GET))
|
||||
|
@ -104,11 +105,7 @@ async fn main() {
|
|||
|
||||
rx.recv().unwrap_or(false)
|
||||
})),
|
||||
);
|
||||
|
||||
let mut app = Router::new()
|
||||
.nest("/api", api_router)
|
||||
.nest("/", files_router)
|
||||
)
|
||||
.with_state(state.clone());
|
||||
|
||||
if config.max_body_limit_size.is_some() {
|
||||
|
|
Loading…
Reference in a new issue