readd implementation folder
This commit is contained in:
parent
7ff078b16f
commit
a4f171b98c
80 changed files with 8471 additions and 0 deletions
21
implementation/06/config/routes.php
Normal file
21
implementation/06/config/routes.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use FastRoute\RouteCollector;
|
||||
use Laminas\Diactoros\Response;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
return function (RouteCollector $r) {
|
||||
$r->addRoute('GET', '/hello[/{name}]', function (ServerRequestInterface $request) {
|
||||
$name = $request->getAttribute('name', 'Stranger');
|
||||
$response = (new Response)->withStatus(200);
|
||||
$response->getBody()
|
||||
->write('Hello ' . $name . '!');
|
||||
return $response;
|
||||
});
|
||||
$r->addRoute('GET', '/other', function (ServerRequestInterface $request) {
|
||||
$response = (new Response)->withStatus(200);
|
||||
$response->getBody()
|
||||
->write('This works too!');
|
||||
return $response;
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue