add data from work folder
This commit is contained in:
parent
97579d6d91
commit
48c9c9467d
218 changed files with 16123 additions and 1233 deletions
17
implementation/06-router/config/routes.php
Normal file
17
implementation/06-router/config/routes.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return function (\FastRoute\RouteCollector $r): void {
|
||||
$r->addRoute('GET', '/hello[/{name}]', function (\Psr\Http\Message\ServerRequestInterface $request) {
|
||||
$name = $request->getAttribute('name', 'Stranger');
|
||||
$response = (new \Laminas\Diactoros\Response())->withStatus(200);
|
||||
$response->getBody()->write('Hello ' . $name . '!');
|
||||
return $response;
|
||||
});
|
||||
$r->addRoute('GET', '/another-route', function (\Psr\Http\Message\ServerRequestInterface $request) {
|
||||
$response = (new \Laminas\Diactoros\Response())->withStatus(200);
|
||||
$response->getBody()->write('This works too!');
|
||||
return $response;
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue