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

23 lines
486 B
Rust
Raw Normal View History

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
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
}