1
0
mirror of https://github.com/actix/actix-website synced 2025-01-23 00:25:55 +01:00

19 lines
414 B
Rust
Raw Normal View History

2019-06-25 18:20:36 -04:00
// <guard2>
use actix_web::{guard, web, App, HttpResponse, HttpServer};
2020-09-12 16:21:54 +01:00
#[actix_web::main]
2019-12-29 04:10:02 +09:00
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()))
2022-02-26 03:56:24 +00:00
.to(HttpResponse::MethodNotAllowed),
2019-06-25 18:20:36 -04:00
)
})
2022-02-26 03:56:24 +00:00
.bind(("127.0.0.1", 8080))?
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>