drhino / request
PSR request handler
0.0.3
2023-06-29 07:00 UTC
Requires
- php: >=7.4
- laminas/laminas-diactoros: ^2.6
- laminas/laminas-httphandlerrunner: ^2.0
- laminas/laminas-stratigility: ^3.4
- nikic/fast-route: ^1.3
- symfony/polyfill-intl-normalizer: ^1.23
README
Route request handler.
composer require drhino/request
<?php declare(strict_types=1); # require __DIR__ . '/vendor/autoload.php'; $routes = function(\FastRoute\RouteCollector $r) { $r->get('/{name}', drhino\Request\Example\IndexHandler::class); $r->post('/', drhino\Request\Example\PostHandler::class); }; // Default headers, unless otherwise specified in the response. $headers = [ 'Access-Control-Allow-Origin' => '*', 'Cache-Control' => 'no-store' ]; new \drhino\Request\Handler($routes, $headers);