1
0
mirror of https://github.com/actix/actix-website synced 2025-03-16 05:02:45 +01:00
2019-06-28 13:31:30 -04:00

23 lines
486 B
Rust

use actix_web::HttpResponse;
fn index() -> HttpResponse {
HttpResponse::Ok().body("Hello")
}
// <norm>
use actix_web::{http::Method, middleware, web, App, HttpServer};
pub fn main() {
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();
}
// </norm>