1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +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

@ -13,7 +13,8 @@ fn main() {
HttpServer::new(
|| Application::new()
.resource("/{name}", |r| r.f(index)))
.serve("127.0.0.1:8080");
.bind("127.0.0.1:8080")?
.start();
}
```
@ -34,8 +35,7 @@ fn main() {
* Transparent content compression/decompression (br, gzip, deflate)
* Configurable request routing
* Multipart streams
* Middlewares (
[Logger](https://actix.github.io/actix-web/guide/qs_10.html#logging),
* Middlewares ([Logger](https://actix.github.io/actix-web/guide/qs_10.html#logging),
[Session](https://actix.github.io/actix-web/guide/qs_10.html#user-sessions),
[DefaultHeaders](https://actix.github.io/actix-web/guide/qs_10.html#default-headers))
* Built on top of [Actix](https://github.com/actix/actix).