1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

renamed Route::handler to Route::f, added Route::h to register Handler

This commit is contained in:
Nikolay Kim
2017-12-04 14:07:53 -08:00
parent 03f7d95d88
commit f5d6179a34
19 changed files with 79 additions and 40 deletions

View File

@ -16,7 +16,7 @@ fn create_server<T, A>() -> HttpServer<T, A, Application<()>> {
HttpServer::new(
vec![Application::default("/")
.resource("/", |r|
r.route().method(Method::GET).handler(|_| httpcodes::HTTPOk))
r.route().method(Method::GET).h(httpcodes::HTTPOk))
.finish()])
}
@ -94,7 +94,7 @@ fn test_middlewares() {
response: act_num2,
finish: act_num3})
.resource("/", |r|
r.route().method(Method::GET).handler(|_| httpcodes::HTTPOk))
r.route().method(Method::GET).h(httpcodes::HTTPOk))
.finish()])
.serve::<_, ()>("127.0.0.1:58904").unwrap();
sys.run();