mirror of
https://github.com/actix/actix-website
synced 2025-06-29 16:24:58 +02:00
begin update of docs to actix-web 1.0
This commit is contained in:
@ -27,6 +27,7 @@ actix-web = "{{< actix-version "actix-web" >}}"
|
||||
|
||||
In order to implement a web server, we first need to create a request handler.
|
||||
|
||||
<!-- TODO: Handler has been deprecated -->
|
||||
A request handler is a function that accepts an `HttpRequest` instance as its only parameter
|
||||
and returns a type that can be converted into `HttpResponse`:
|
||||
|
||||
@ -34,12 +35,12 @@ Filename: `src/main.rs`
|
||||
|
||||
{{< include-example example="getting-started" section="setup" >}}
|
||||
|
||||
<!-- TODO: Return ->
|
||||
Next, create an `Application` instance and register the request handler with
|
||||
the application's `resource` on a particular *HTTP method* and *path* and
|
||||
after that, the application instance can be used with `HttpServer` to listen
|
||||
for incoming connections. The server accepts a function that should return an
|
||||
`HttpHandler` instance. For simplicity `server::new` could be used, this
|
||||
function is shortcut for `HttpServer::new`:
|
||||
`HttpResponse`.
|
||||
|
||||
{{< include-example example="getting-started" section="main" >}}
|
||||
|
||||
|
@ -9,7 +9,7 @@ weight: 110
|
||||
Since `actix-web` is a Rust framework you will need Rust to get started with it.
|
||||
If you don't have it yet we recommend you use `rustup` to manage your Rust
|
||||
installation. The [official rust
|
||||
guide](https://doc.rust-lang.org/book/second-edition/ch01-01-installation.html)
|
||||
guide](https://doc.rust-lang.org/book/ch01-01-installation.html)
|
||||
has a wonderful section on getting started.
|
||||
|
||||
We currently require at least Rust 1.24 so make sure you run `rustup update`
|
||||
@ -18,7 +18,7 @@ guide will assume that you actually run Rust 1.26 or later.
|
||||
|
||||
# Installing `actix-web`
|
||||
|
||||
Thank's to Rust's `cargo` package manager you won't need to explicitly install
|
||||
Thanks to Rust's `cargo` package manager you won't need to explicitly install
|
||||
`actix-web`. Just depend on it and you're ready to go. For the unlikely
|
||||
case that you want to use the development version of actix-web you can
|
||||
depend on the git repository directly.
|
||||
|
Reference in New Issue
Block a user