Skip to content

jpirnat/middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a basic PSR-15 middleware dispatcher using PSR-11 ContainerInterface to retrieve middlewares.

Usage

$app = function (ServerRequestInterface $request) : ResponseInterface {
    // This closure will be executed at the center of the middleware stack.
    // Use it to wrap your application, or to return a default response.
}

$dispatcher = new Dispatcher($container, $app);

$dispatcher->addMiddlewares([
    ExampleMiddleware::class, // identifiers for $container
    // ...
]);

$response = $dispatcher->handle($request);

About

PSR-15 middleware dispatcher using PSR-11 to retrieve middlewares

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages