aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-11-23 17:40:02 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-11-23 18:15:01 +0100
commit7154b16dedd29f0188c3040816e0013198e3bf63 (patch)
tree667889133951c93c8f31b9f86088fd7c091524d4 /planetwars-server
parentee57f06544a7281138ee909995fde4a1b3993c4b (diff)
downloadplanetwars.dev-7154b16dedd29f0188c3040816e0013198e3bf63.tar.xz
planetwars.dev-7154b16dedd29f0188c3040816e0013198e3bf63.zip
add permissive CORS settings
Diffstat (limited to 'planetwars-server')
-rw-r--r--planetwars-server/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs
index 2045eda..39dd57e 100644
--- a/planetwars-server/src/lib.rs
+++ b/planetwars-server/src/lib.rs
@@ -30,6 +30,7 @@ use axum::{
Router,
};
use tower_http::compression::CompressionLayer;
+use tower_http::cors::CorsLayer;
type ConnectionPool = bb8::Pool<DieselConnectionManager<PgConnection>>;
@@ -153,6 +154,7 @@ pub fn create_pw_api(global_config: Arc<GlobalConfig>, db_pool: DbPool) -> Route
.layer(Extension(db_pool))
.layer(Extension(global_config))
.layer(CompressionLayer::new())
+ .layer(CorsLayer::permissive())
}
pub fn get_config() -> Result<GlobalConfig, ConfigError> {