123456789101112131415161718192021222324252627 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Noa
- * Date: 19/09/2017
- * Time: 19:44
- */
- require_once 'vendor/autoload.php';
- use GuzzleHttp\Psr7\ServerRequest;
- use Middlewares\Whoops;
- use Noa\Example\Middlewares\App;
- use Noa\Middlewares\MiddlewaresHandler;
- use Noa\Example\Middlewares\NoaMiddleware;
- $request = ServerRequest::fromGlobals();
- $handler = new MiddlewaresHandler();
- $response = $handler->create()
- ->pipe(new App())
- ->pipe(new NoaMiddleware())
- ->pipe(new Whoops())
- ->process($request);
- \Http\Response\send($response);
|