diff --git a/doc/book/getting-started/standalone.md b/doc/book/getting-started/standalone.md index db1eaac1..5397900b 100644 --- a/doc/book/getting-started/standalone.md +++ b/doc/book/getting-started/standalone.md @@ -67,6 +67,8 @@ $app->get('/', function ($request, $response, $next) { return $response; }); +$app->pipeRoutingMiddleware(); +$app->pipeDispatchMiddleware(); $app->run(); ``` @@ -77,6 +79,21 @@ $app->run(); > your bootstrap is invoked for unknown URLs. We'll cover that in a later > chapter. +> ### Routing and dispatching +> +> Note the lines from the above: +> +> ```php +> $app->pipeRoutingMiddleware(); +> $app->pipeDispatchMiddleware(); +> ``` +> +> Expressive's `Application` class provides two separate middlewares, one for +> routing, and one for dispatching middleware matched by routing. This allows +> you to slip in validations between the two activities if desired. They are +> not automatically piped to the application, however, to allow exactly that +> situation, which means they must be piped manually. + ## 5. Start a web server Since we're just testing out the basic functionality of our application, we'll