mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 06:39:22 +02:00
update readme
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
# Quickstart
|
||||
# Quick start
|
||||
|
||||
Before you can start writing a actix web application, you’ll need a version of Rust installed.
|
||||
We recommend you use rustup to install or configure such a version.
|
||||
|
@ -6,7 +6,7 @@ websocket protcol handling, multipart streams, etc.
|
||||
|
||||
All actix web server is built around `Application` instance.
|
||||
It is used for registering routes for resources, middlewares.
|
||||
Also it stores application specific state that is shared accross all handlers
|
||||
Also it stores application specific state that is shared across all handlers
|
||||
within same application.
|
||||
|
||||
Application acts as namespace for all routes, i.e all routes for specific application
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Http server automatically starts number of http workers, by default
|
||||
this number is equal to number of logical cpu in the system. This number
|
||||
could be overriden with `HttpServer::threads()` method.
|
||||
could be overridden with `HttpServer::threads()` method.
|
||||
|
||||
```rust
|
||||
# extern crate actix_web;
|
||||
@ -53,7 +53,7 @@ fn main() {
|
||||
}
|
||||
```
|
||||
|
||||
Note on *HTTP/2.0* protocol over tls without prior knowlage, it requires
|
||||
Note on *HTTP/2.0* protocol over tls without prior knowledge, it requires
|
||||
[tls alpn](https://tools.ietf.org/html/rfc7301). At the moment only
|
||||
`openssl` has `alpn ` support.
|
||||
|
||||
@ -62,7 +62,7 @@ for concrete example.
|
||||
|
||||
## Keep-Alive
|
||||
|
||||
Actix can wait for requesta on a keep-alive connection. *Keep alive*
|
||||
Actix can wait for requests on a keep-alive connection. *Keep alive*
|
||||
connection behavior is defined by server settings.
|
||||
|
||||
* `Some(75)` - enable 75 sec *keep alive* timer according request and response settings.
|
||||
|
@ -41,9 +41,8 @@ fn index(req: HttpRequest) -> Box<Future<Item=HttpResponse, Error=Error>> {
|
||||
|
||||
## Response with custom type
|
||||
|
||||
To return custom type directly from handler function `FromResponse` trait should be
|
||||
implemented for this type. Let's create response for custom type that
|
||||
serializes to `application/json` response:
|
||||
To return custom type directly from handler function type needs to implement `Responder` trait.
|
||||
Let's create response for custom type that serializes to `application/json` response:
|
||||
|
||||
```rust
|
||||
# extern crate actix;
|
||||
|
Reference in New Issue
Block a user