update readme

This commit is contained in:
lubiana 2022-04-05 00:02:52 +02:00 committed by Andre Lubian
parent b12cf019e7
commit ab3227b75f
88 changed files with 7546 additions and 176 deletions

View file

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