1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

upgrade to alpha.6

This commit is contained in:
Nikolay Kim
2019-04-14 10:34:41 -07:00
parent 8fb2bf6869
commit 09b0188ff9
13 changed files with 93 additions and 117 deletions

View File

@ -124,16 +124,17 @@ fn main() -> io::Result<()> {
.finish()
})))
// default
.default_resource(|r| {
.default_service(
// 404 for GET request
r.route(web::get().to(p404))
web::resource("")
.route(web::get().to(p404))
// all requests that are not `GET`
.route(
web::route()
.guard(guard::Not(guard::Get()))
.to(|| HttpResponse::MethodNotAllowed()),
)
})
),
)
})
.bind("127.0.0.1:8080")?
.start();