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

better handler result handling

This commit is contained in:
Nikolay Kim
2017-11-28 12:42:53 -08:00
parent 0bd8725426
commit b55d69b4c2
4 changed files with 9 additions and 15 deletions

View File

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