@@ -11,7 +11,7 @@ VSGI (Vala Server Gateway Interface) offers abstractions for different web
11
11
server technologies. You can choose which implementation you want with
12
12
a ``using `` statement, as they all respect a common interface.
13
13
14
- Two implementations exist at the moment and a few more are planned in the next
14
+ Two implementations exist at the moment and a few more are planned in a future
15
15
minor release.
16
16
17
17
- :doc: `server/soup `
@@ -26,11 +26,11 @@ Creating an application
26
26
-----------------------
27
27
28
28
An application is defined by a class that implements the ``VSGI.Application ``
29
- interface. It declares a simple ``handle `` async function that takes
29
+ interface. It declares a simple ``handle `` function that takes
30
30
a :doc: `vsgi/request ` and :doc: `vsgi/response ` as input and process them.
31
31
32
- Valum provides a :doc: `router `, which provides powerful facilities for routing
33
- client requests. Your application is therefore an instance of that class.
32
+ Valum provides a :doc: `router ` with powerful facilities for routing client
33
+ requests. Your application is an instance of that class.
34
34
35
35
.. code :: vala
36
36
@@ -39,21 +39,22 @@ client requests. Your application is therefore an instance of that class.
39
39
Binding a route
40
40
---------------
41
41
42
- An application constitute of a list of routes matching user requests. To
43
- declare a route, the `` Router `` class provides useful helpers and low-level
44
- utilities .
42
+ An application constitute of a list of routes matching and handling user
43
+ requests. The router provides helpers to declare routes which internally use
44
+ a :doc: ` route ` instance .
45
45
46
46
.. code :: vala
47
47
48
- app.get ("", (req, res) => {
48
+ app.get ("", (req, res, next ) => {
49
49
res.write ("Hello world!".data);
50
50
});
51
51
52
52
Every route declaration has a callback associated that does the request
53
- processing. The callback receives two arguments:
53
+ processing. The callback receives three arguments:
54
54
55
55
- a :doc: `vsgi/request ` that describes a resource being requested
56
56
- a :doc: `vsgi/response ` that correspond to that resource
57
+ - a ``next `` continuation to `keep routing `
57
58
58
59
These two inherit respectively from ``InputStream `` and ``OutputStream ``,
59
60
allowing any synchronous and asynchronous stream operations. You can use
0 commit comments