mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-30 18:34:36 +01:00
simplify guide examples
This commit is contained in:
parent
bca1dd4f9e
commit
55534bff8c
@ -20,7 +20,7 @@ fn main() {
|
||||
|
||||
HttpServer::new(
|
||||
|| Application::new()
|
||||
.resource("/", |r| r.f(|_| httpcodes::HTTPOk)))
|
||||
.resource("/", |r| r.h(httpcodes::HTTPOk)))
|
||||
.bind("127.0.0.1:59080").unwrap()
|
||||
.start();
|
||||
|
||||
@ -46,7 +46,7 @@ use actix_web::*;
|
||||
fn main() {
|
||||
HttpServer::<TcpStream, SocketAddr, _, _>::new(
|
||||
|| Application::new()
|
||||
.resource("/", |r| r.f(|_| httpcodes::HTTPOk)))
|
||||
.resource("/", |r| r.h(httpcodes::HTTPOk)))
|
||||
.threads(4); // <- Start 4 workers
|
||||
}
|
||||
```
|
||||
@ -109,7 +109,7 @@ use actix_web::*;
|
||||
fn main() {
|
||||
HttpServer::<TcpStream, SocketAddr, _, _>::new(||
|
||||
Application::new()
|
||||
.resource("/", |r| r.f(|r| httpcodes::HTTPOk)))
|
||||
.resource("/", |r| r.h(httpcodes::HTTPOk)))
|
||||
.keep_alive(None); // <- Use `SO_KEEPALIVE` socket option.
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user