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

19 lines
415 B
Rust
Raw Normal View History

2019-06-25 18:20:36 -04:00
// <guard2>
use actix_web::{guard, web, App, HttpResponse, HttpServer};
2019-12-29 04:10:02 +09:00
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
2019-06-25 18:20:36 -04:00
HttpServer::new(|| {
App::new().route(
"/",
web::route()
.guard(guard::Not(guard::Get()))
.to(|| HttpResponse::MethodNotAllowed()),
)
})
2019-12-29 04:10:02 +09:00
.bind("127.0.0.1:8088")?
2019-06-25 18:20:36 -04:00
.run()
2019-12-29 04:10:02 +09:00
.await
2019-06-25 18:20:36 -04:00
}
// </guard2>