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:
@ -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).
|
||||
|
Reference in New Issue
Block a user