mirror of
https://github.com/actix/actix-website
synced 2025-01-23 08:34:35 +01:00
17 lines
401 B
Rust
17 lines
401 B
Rust
|
// <auto>
|
||
|
use actix_web::{
|
||
|
http::ContentEncoding, middleware, web, App, HttpRequest, HttpResponse,
|
||
|
};
|
||
|
|
||
|
fn index(req: HttpRequest) -> HttpResponse {
|
||
|
HttpResponse::Ok().body("data")
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let app = App::new()
|
||
|
// v- disable compression for all routes
|
||
|
.wrap(middleware::Compress::new(ContentEncoding::Identity))
|
||
|
.route("/", web::get().to(index));
|
||
|
}
|
||
|
// </auto>
|