mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
Update information on Compress middleware (#279)
This commit is contained in:
@ -1,20 +0,0 @@
|
||||
// <brotli>
|
||||
use actix_web::{get, middleware, App, HttpResponse, HttpServer};
|
||||
|
||||
#[get("/")]
|
||||
async fn index_br() -> HttpResponse {
|
||||
HttpResponse::Ok().body("data")
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap(middleware::Compress::default())
|
||||
.service(index_br)
|
||||
})
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
// </brotli>
|
@ -1,21 +0,0 @@
|
||||
// <brotli-two>
|
||||
use actix_web::{http::ContentEncoding, dev::BodyEncoding, HttpResponse};
|
||||
|
||||
async fn index_br() -> HttpResponse {
|
||||
HttpResponse::Ok().body("data")
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
use actix_web::{middleware, web, App, HttpServer};
|
||||
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap(middleware::Compress::new(ContentEncoding::Br))
|
||||
.route("/", web::get().to(index_br))
|
||||
})
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
// </brotli-two>
|
@ -1,20 +0,0 @@
|
||||
// <compress>
|
||||
use actix_web::{get, middleware, App, HttpResponse, HttpServer};
|
||||
|
||||
#[get("/")]
|
||||
async fn index_br() -> HttpResponse {
|
||||
HttpResponse::Ok().body("data")
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap(middleware::Compress::default())
|
||||
.service(index_br)
|
||||
})
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
// </compress>
|
@ -1,7 +1,5 @@
|
||||
pub mod auto;
|
||||
pub mod brotli;
|
||||
pub mod chunked;
|
||||
pub mod compress;
|
||||
pub mod identity;
|
||||
pub mod identity_two;
|
||||
pub mod json_resp;
|
||||
|
Reference in New Issue
Block a user