1
0
mirror of https://github.com/actix/actix-website synced 2025-02-23 12:43:02 +01:00

20 lines
442 B
Rust
Raw Normal View History

2019-06-17 15:15:33 -04:00
// <brotli>
2019-06-26 01:58:47 -04:00
use actix_web::{http::ContentEncoding, middleware::BodyEncoding, HttpResponse};
2019-06-17 15:15:33 -04:00
2019-06-26 01:58:47 -04:00
fn index_br() -> HttpResponse {
2019-06-17 15:15:33 -04:00
HttpResponse::Ok()
.encoding(ContentEncoding::Br)
.body("data")
}
// </brotli>
pub fn main() {
2019-06-26 01:58:47 -04:00
use actix_web::{web, App, HttpServer};
HttpServer::new(|| App::new().route("/", web::get().to(index_br)))
.bind("127.0.0.1:8088")
.unwrap()
.run()
.unwrap();
}