2019-06-17 15:15:33 -04:00
|
|
|
// <auto>
|
2019-06-26 01:58:47 -04:00
|
|
|
use actix_web::{http::ContentEncoding, middleware, HttpResponse};
|
2019-06-17 15:15:33 -04:00
|
|
|
|
2019-06-26 01:58:47 -04:00
|
|
|
fn index() -> HttpResponse {
|
2019-06-17 15:15:33 -04:00
|
|
|
HttpResponse::Ok().body("data")
|
|
|
|
}
|
|
|
|
|
2019-06-19 00:20:50 -04:00
|
|
|
pub fn main() {
|
2019-06-26 01:58:47 -04:00
|
|
|
use actix_web::{web, App, HttpServer};
|
|
|
|
|
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new()
|
|
|
|
// v- disable compression for all routes
|
|
|
|
.wrap(middleware::Compress::new(ContentEncoding::Identity))
|
|
|
|
.route("/", web::get().to(index))
|
|
|
|
})
|
|
|
|
.bind("127.0.0.1:8088")
|
|
|
|
.unwrap()
|
|
|
|
.run()
|
|
|
|
.unwrap();
|
2019-06-17 15:15:33 -04:00
|
|
|
}
|
|
|
|
// </auto>
|