This commit is contained in:
lubiana 2022-03-31 08:34:30 +02:00 committed by Andre Lubian
parent 48c9c9467d
commit b12cf019e7
107 changed files with 8372 additions and 186 deletions

View file

@ -0,0 +1,12 @@
<?php declare(strict_types=1);
use FastRoute\RouteCollector;
use Lubian\NoFramework\Action\Hello;
use Lubian\NoFramework\Action\Other;
use Psr\Http\Message\ResponseInterface as Response;
return function (RouteCollector $r): void {
$r->addRoute('GET', '/hello[/{name}]', Hello::class);
$r->addRoute('GET', '/another-route', [Other::class, 'someFunctionName']);
$r->addRoute('GET', '/', fn (Response $r) => $r->withStatus(302)->withHeader('Location', '/hello'));
};