mirror of
https://github.com/moghtech/komodo.git
synced 2026-04-28 11:49:39 -05:00
clean up cors
This commit is contained in:
@@ -80,7 +80,12 @@ async fn app() -> anyhow::Result<()> {
|
||||
.nest("/client", ts_client::router())
|
||||
.nest_service("/", serve_dir)
|
||||
.fallback_service(frontend_index)
|
||||
.layer(cors()?)
|
||||
.layer(
|
||||
CorsLayer::new()
|
||||
.allow_origin(Any)
|
||||
.allow_methods(Any)
|
||||
.allow_headers(Any),
|
||||
)
|
||||
.into_make_service();
|
||||
|
||||
let socket_addr =
|
||||
@@ -123,11 +128,3 @@ async fn main() -> anyhow::Result<()> {
|
||||
_ = term_signal.recv() => Ok(()),
|
||||
}
|
||||
}
|
||||
|
||||
fn cors() -> anyhow::Result<CorsLayer> {
|
||||
let cors = CorsLayer::new()
|
||||
.allow_origin(Any)
|
||||
.allow_methods(Any)
|
||||
.allow_headers(Any);
|
||||
Ok(cors)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user