mirror of
https://github.com/actix/actix-web.git
synced 2024-11-27 12:01:15 +00:00
simplify guide examples
This commit is contained in:
parent
bca1dd4f9e
commit
55534bff8c
1 changed files with 3 additions and 3 deletions
|
@ -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 a new issue