1
0
mirror of https://github.com/actix/actix-website synced 2025-03-15 04:33:07 +01:00
2019-06-25 18:20:36 -04:00

19 lines
389 B
Rust

// <guard2>
use actix_web::{guard, web, App, HttpResponse, HttpServer};
pub fn main() {
HttpServer::new(|| {
App::new().route(
"/",
web::route()
.guard(guard::Not(guard::Get()))
.to(|| HttpResponse::MethodNotAllowed()),
)
})
.bind("127.0.0.1:8088")
.unwrap()
.run()
.unwrap();
}
// </guard2>