Skip to content

alextodorov/super-simple-http-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Super Simple Http Handler

A Super Simple HTTP Handler library implementing the PSR-15.

Build Status

Install

composer require super-simple/http-server-handler

Requires PHP 8.1 or newer.

Usage

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.

About

Super Simple Http library implementing the PSR-15.

Resources

License

Stars

Watchers

Forks

Packages

No packages published