Relay is a PSR-15 server request handler (aka “dispatcher”) for a queue of PSR-15 middleware entries. Request Handling First, create an array or traversable $queue of middleware entries: $queue[] = new FooMiddleware(); $queue[] = new BarMiddleware(); $queue[] = new BazMiddleware(); // ... $queue[] = new class implements Psr\Http\Server\MiddlewareInterface { public function process( Psr\Http\Messag