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

refactor server router

This commit is contained in:
Nikolay Kim
2017-10-21 18:54:24 -07:00
parent 0d6e42e748
commit 6a33b65f02
10 changed files with 173 additions and 373 deletions

View File

@ -12,14 +12,14 @@ use futures::Future;
use tokio_core::net::{TcpStream, TcpListener};
fn create_server<T, A>() -> HttpServer<T, A> {
fn create_server<T, A>() -> HttpServer<T, A, Application<()>> {
HttpServer::new(
RoutingMap::default()
.resource("/", |r|
r.handler(Method::GET, |_, _, _| {
httpcodes::HTTPOk
}))
.finish())
vec![Application::default("/")
.resource("/", |r|
r.handler(Method::GET, |_, _, _| {
httpcodes::HTTPOk
}))
.finish()])
}
#[test]