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

refactor server bind and start process

This commit is contained in:
Nikolay Kim
2017-12-17 12:35:04 -08:00
parent 4b421b44a2
commit 27d92f3a23
10 changed files with 139 additions and 103 deletions

View File

@ -81,7 +81,8 @@ fn main() {
HttpServer::new(
|| Application::new()
.resource("/", |r| r.f(index)))
.serve::<_, ()>("127.0.0.1:8088").unwrap();
.bind("127.0.0.1:8088").unwrap()
.start();
println!("Started http server: 127.0.0.1:8088");
# actix::Arbiter::system().send(actix::msgs::SystemExit(0));

View File

@ -82,7 +82,8 @@ fn main() {
HttpServer::new(
|| Application::new()
.resource("/", |r| r.method(Method::GET).f(index)))
.serve::<_, ()>("127.0.0.1:8088").unwrap();
.bind("127.0.0.1:8088").unwrap()
.start();
println!("Started http server: 127.0.0.1:8088");
# actix::Arbiter::system().send(actix::msgs::SystemExit(0));