1
0
mirror of https://github.com/actix/actix-website synced 2025-08-30 16:40:22 +02:00

Intro: done-ish. Getting Started: done-ish. Application: done-ish.

This commit is contained in:
Cameron Dershem
2019-06-19 18:00:31 -04:00
parent da969fed1f
commit ea7bc84f8d
11 changed files with 145 additions and 66 deletions

View File

@@ -6,7 +6,7 @@ weight: 130
# Getting Started
Lets write our first actix web application!
Lets write our first `actix-web` application!
## Hello, world!
@@ -27,17 +27,16 @@ actix-web = "{{< actix-version "actix-web" >}}"
In order to implement a web server, we first need to create a request handler.
A request handler is a function that accepts any type that can be extracted from a
request (ie, `impl FromRequest`) as its only parameter and returns a type that
can be converted into an `HttpResponse` (ie, `impl Responder`):
A request handler is a 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 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
application factory.
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
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" >}}