From 687e11e1e413d0bb6e07aa2b603ba8f0cbeaeb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20=C5=BBuk?= Date: Tue, 17 Sep 2024 19:57:10 +0200 Subject: [PATCH] Add compression support --- fplus-http-server/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fplus-http-server/src/main.rs b/fplus-http-server/src/main.rs index 212c3805..f001cafd 100644 --- a/fplus-http-server/src/main.rs +++ b/fplus-http-server/src/main.rs @@ -5,7 +5,10 @@ use middleware::verifier_auth::VerifierAuth; pub(crate) mod router; use std::env; -use actix_web::{middleware::Logger, web, App, HttpServer}; +use actix_web::{ + middleware::{Compress, Logger}, + web, App, HttpServer, +}; use chrono::Utc; use cron::Schedule; @@ -65,6 +68,7 @@ async fn main() -> std::io::Result<()> { .allow_any_method() .allow_any_header(); App::new() + .wrap(Compress::default()) .wrap(Logger::default()) .wrap(cors) .service(router::health)