2018-05-24 10:13:55 -07:00
|
|
|
// <norm>
|
2019-06-25 18:20:36 -04:00
|
|
|
use actix_web::{http::Method, middleware, web, App, HttpServer};
|
2018-05-24 10:13:55 -07:00
|
|
|
|
2019-06-19 00:20:50 -04:00
|
|
|
pub fn main() {
|
2019-06-25 18:20:36 -04:00
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new()
|
|
|
|
.wrap(middleware::NormalizePath)
|
|
|
|
.route("/resource/", web::get().to(index))
|
|
|
|
.default_service(web::route().method(Method::GET))
|
|
|
|
})
|
|
|
|
.bind("127.0.0.1:8088")
|
|
|
|
.unwrap()
|
|
|
|
.run()
|
|
|
|
.unwrap();
|
2018-05-24 10:13:55 -07:00
|
|
|
}
|
|
|
|
// </norm>
|
|
|
|
|
2019-06-25 18:20:36 -04:00
|
|
|
use actix_web::HttpResponse;
|
2018-05-24 10:13:55 -07:00
|
|
|
|
2019-06-25 18:20:36 -04:00
|
|
|
fn index() -> HttpResponse {
|
|
|
|
HttpResponse::Ok().body("Hello")
|
2018-05-24 10:13:55 -07:00
|
|
|
}
|