diff --git a/config.toml b/config.toml index 72274c9..7ee657c 100644 --- a/config.toml +++ b/config.toml @@ -17,5 +17,6 @@ baseURL = "https://actix.rs" [params] actixVersion = "0.9" actixWebVersion = "2.0" +actixRtVersion = "1.0" actixWebMinRustVersion = "1.39" actixMinRustVersion = "1.39" diff --git a/content/_index.md b/content/_index.md index 7e9a9a9..e9b2885 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,3 +1,3 @@ --- -title: Actix - Actor System and Web Framework for Rust +title: rust's powerful actor system and most fun web framework --- diff --git a/content/docs/getting-started.md b/content/docs/getting-started.md index 0ede4d0..aa7ffab 100644 --- a/content/docs/getting-started.md +++ b/content/docs/getting-started.md @@ -23,25 +23,26 @@ contains the following: ```ini [dependencies] actix-web = "{{< actix-version "actix-web" >}}" +actix-rt = "{{< actix-version "actix-rt" >}}" ``` In order to implement a web server, we first need to create a request handler. -A request handler is a function that accepts zero or more parameters that can be +A request handler is an async function that accepts zero or more parameters that can be extracted from a request (ie, `impl FromRequest`) and returns a type that can be converted into an `HttpResponse` (ie, `impl Responder`): {{< include-example example="getting-started" section="setup" >}} Next, create an `App` instance and register the request handler with the application's -`route` on a *path* and with a particular *HTTP method*. After that, the application +`route` on a _path_ and with a particular _HTTP method_. After that, the application instance can be used with `HttpServer` to listen for incoming connections. The server accepts a function that should return an application factory. {{< include-example example="getting-started" section="main" >}} That's it! Now, compile and run the program with `cargo run`. -Head over to ``http://localhost:8088/`` to see the results. +Head over to `http://localhost:8088/` to see the results. ### Using Attribute Macros to Define Routes diff --git a/examples/getting-started/Cargo.toml b/examples/getting-started/Cargo.toml index fee4ef7..2f5db24 100644 --- a/examples/getting-started/Cargo.toml +++ b/examples/getting-started/Cargo.toml @@ -6,4 +6,4 @@ workspace = "../" [dependencies] actix-web = "2.0" -actix-rt = "1.0" +actix-rt = "1.0.0" diff --git a/layouts/index.html b/layouts/index.html index b2f0d4f..307f635 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,7 +4,8 @@
rust's powerful actor system and most fun web framework
+rust's powerful actor system and most fun web framework +
Easily create your own libraries that any Actix application can use.
-Actix is blazingly fast. Don't take our word for it -- see for yourself!
+Actix is blazingly fast. Don't take our word for it -- see for yourself!
+ - -
Handler functions in actix can return a wide range of objects that
- implement the Responder
trait. This makes it a breeze
+ implement the Responder
trait. This makes it a breeze
to return consistent responses from your APIs.
- Handling multipart/urlencoded form data is easy. Just define + Handling multipart/urlencoded form data is easy. Just define a structure that can be deserialized and actix will handle the rest.
@@ -117,7 +119,7 @@ struct Register { country: String, } -fn register(form: web::FormAn actix app comes with a URL routing system that lets you match on - URLs and invoke individual handlers. For extra flexibility, scopes + URLs and invoke individual handlers. For extra flexibility, scopes can be used.
- {{ highlight `fn index(_req: HttpRequest) -> impl Responder { + {{ highlight `async fn index(_req: HttpRequest) -> impl Responder { "Hello from the index page!" } -fn hello(path: web::Path