Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit fcad6cf

Browse files
committed
Updated standalone example to pipe routing/dispatch middleware
1 parent 4e0fe3b commit fcad6cf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/book/getting-started/standalone.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ $app->get('/', function ($request, $response, $next) {
6767
return $response;
6868
});
6969

70+
$app->pipeRoutingMiddleware();
71+
$app->pipeDispatchMiddleware();
7072
$app->run();
7173
```
7274

@@ -77,6 +79,21 @@ $app->run();
7779
> your bootstrap is invoked for unknown URLs. We'll cover that in a later
7880
> chapter.
7981
82+
> ### Routing and dispatching
83+
>
84+
> Note the lines from the above:
85+
>
86+
> ```php
87+
> $app->pipeRoutingMiddleware();
88+
> $app->pipeDispatchMiddleware();
89+
> ```
90+
>
91+
> Expressive's `Application` class provides two separate middlewares, one for
92+
> routing, and one for dispatching middleware matched by routing. This allows
93+
> you to slip in validations between the two activities if desired. They are
94+
> not automatically piped to the application, however, to allow exactly that
95+
> situation, which means they must be piped manually.
96+
8097
## 5. Start a web server
8198
8299
Since we're just testing out the basic functionality of our application, we'll

0 commit comments

Comments
 (0)