index.php 573 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Noa
  5. * Date: 19/09/2017
  6. * Time: 19:44
  7. */
  8. require_once 'vendor/autoload.php';
  9. use GuzzleHttp\Psr7\ServerRequest;
  10. use Middlewares\Whoops;
  11. use Noa\Example\Middlewares\App;
  12. use Noa\Middlewares\MiddlewaresHandler;
  13. use Noa\Example\Middlewares\NoaMiddleware;
  14. $request = ServerRequest::fromGlobals();
  15. $handler = new MiddlewaresHandler();
  16. $response = $handler->create()
  17. ->pipe(new App())
  18. ->pipe(new NoaMiddleware())
  19. ->pipe(new Whoops())
  20. ->process($request);
  21. \Http\Response\send($response);