1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

refactor middlewares

This commit is contained in:
Nikolay Kim
2017-11-09 22:08:54 -08:00
parent 51cd08ef57
commit 40c1d3b711
12 changed files with 355 additions and 117 deletions

View File

@ -49,8 +49,8 @@ fn main() {
HttpServer::new(
Application::default("/")
// enable logger
.middleware(Logger::new(None))
// register simple handler, handle all methods
.middleware(middlewares::Logger::new(None))
// register simple handle r, handle all methods
.handler("/index.html", index)
// with path parameters
.resource("/user/{name}/", |r| r.handler(Method::GET, with_param))