From fa3e8c3851b1993a3755ed0f308518ccdf7dc898 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Thu, 28 Mar 2024 09:15:25 +0000 Subject: [PATCH] examples/actix-web.rs: Default enable compress middleware. Signed-off-by: Jonathan Davies --- examples/actix-web.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/actix-web.rs b/examples/actix-web.rs index d01a1027..a1ce8e79 100644 --- a/examples/actix-web.rs +++ b/examples/actix-web.rs @@ -1,5 +1,6 @@ use std::sync::Mutex; +use actix_web::middleware::Compress; use actix_web::{web, App, HttpResponse, HttpServer, Responder, Result}; use prometheus_client::encoding::text::encode; use prometheus_client::encoding::{EncodeLabelSet, EncodeLabelValue}; @@ -61,6 +62,7 @@ async fn main() -> std::io::Result<()> { HttpServer::new(move || { App::new() + .wrap(Compress::default()) .app_data(metrics.clone()) .app_data(state.clone()) .service(web::resource("/metrics").route(web::get().to(metrics_handler)))