A Super Simple HTTP Handler library implementing the PSR-15.
composer require super-simple/http-server-handler
Requires PHP 8.1 or newer.
Basic usage:
// Create a handler, the $defaultResponse must implement Psr\Http\Message\ResponseInterface.
$handler = new HTTPServerHandler($defaultResponse);
// Handle the request
$response = $handler->handle($request);
It's possible to add Middlewares.
//.... create a handler
// The $middleware must implement Psr\Http\Server\MiddlewareInterface
$handler->addMiddleware($middlware);
// ... handle the request.
For more details check out the wiki.