update chapter 10 solutions
This commit is contained in:
parent
e91a166816
commit
fcf5bf2653
3 changed files with 9 additions and 8 deletions
|
@ -3,10 +3,10 @@
|
|||
use FastRoute\RouteCollector;
|
||||
use Lubian\NoFramework\Action\Hello;
|
||||
use Lubian\NoFramework\Action\Other;
|
||||
use Psr\Http\Message\ResponseInterface as RI;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
return function (RouteCollector $r) {
|
||||
$r->addRoute('GET', '/hello[/{name}]', Hello::class);
|
||||
$r->addRoute('GET', '/other', [Other::class, 'handle']);
|
||||
$r->addRoute('GET', '/', fn (RI $r) => $r->withStatus(302)->withHeader('Location', '/hello'));
|
||||
$r->addRoute('GET', '/', fn (ResponseInterface $r) => $r->withHeader('Location', '/hello') ->withStatus(302));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue