From f7eedc6ca1156ed5c29bfef503c233f2aaa1ad48 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Mon, 10 Oct 2022 13:23:18 +0200 Subject: enable request & response compression --- planetwars-server/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'planetwars-server/src') diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs index 1301adb..62bf198 100644 --- a/planetwars-server/src/lib.rs +++ b/planetwars-server/src/lib.rs @@ -29,6 +29,7 @@ use axum::{ routing::{get, post}, Router, }; +use tower_http::compression::CompressionLayer; type ConnectionPool = bb8::Pool>; @@ -147,6 +148,7 @@ pub fn create_pw_api(global_config: Arc, db_pool: DbPool) -> Route .nest("/api", api()) .layer(Extension(db_pool)) .layer(Extension(global_config)) + .layer(CompressionLayer::new()) } pub fn get_config() -> Result { -- cgit v1.2.3