Hy all I’m trying to implements an application middleware
I got the example from documentatio
class simpleAuth
{
/**
* Example middleware invokable class
*
* @param \Psr\Http\Message\ServerRequestInterface $request PSR7 request
* @param \Psr\Http\Message\ResponseInterface $response PSR7 response
* @param callable $next Next middleware
*
* @return \Psr\Http\Message\ResponseInterface
*/
public function __invoke($request,$response,$next)
{
//doing some stuffs... without modifing response
return $response;
}
}
middleware is added with
$app->add( new \simpleAuth());
$app->run();
the middleware is invoked but the route is not dispatched
if I comment the ->add route is dipatched normally
what I have missed ?