generated from t/malachite
fix: access control allow origin
This commit is contained in:
parent
d06bc5e726
commit
bff797569d
1 changed files with 9 additions and 1 deletions
|
@ -1,11 +1,15 @@
|
|||
mod routes;
|
||||
|
||||
use axum::{Extension, Router};
|
||||
use axum::{
|
||||
Extension, Router,
|
||||
http::{HeaderValue, header::ACCESS_CONTROL_ALLOW_ORIGIN},
|
||||
};
|
||||
use buckets_core::{Config, DataManager};
|
||||
use std::{env::var, net::SocketAddr, sync::Arc};
|
||||
use tokio::sync::RwLock;
|
||||
use tower_http::{
|
||||
catch_panic::CatchPanicLayer,
|
||||
set_header::SetResponseHeaderLayer,
|
||||
trace::{self, TraceLayer},
|
||||
};
|
||||
use tracing::{Level, info};
|
||||
|
@ -56,6 +60,10 @@ async fn main() {
|
|||
.make_span_with(trace::DefaultMakeSpan::new().level(Level::INFO))
|
||||
.on_response(trace::DefaultOnResponse::new().level(Level::INFO)),
|
||||
)
|
||||
.layer(SetResponseHeaderLayer::overriding(
|
||||
ACCESS_CONTROL_ALLOW_ORIGIN,
|
||||
HeaderValue::from_static("*"),
|
||||
))
|
||||
.layer(CatchPanicLayer::new());
|
||||
|
||||
// ...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue