From 18fd73a899602a473044013854a354254062ebd4 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 12 Aug 2018 00:08:52 +0200 Subject: Moved middleware to application config --- public/index.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'public') diff --git a/public/index.php b/public/index.php index 88e57252..4e345a7c 100644 --- a/public/index.php +++ b/public/index.php @@ -2,10 +2,6 @@ use Engelsystem\Application; use Engelsystem\Middleware\Dispatcher; -use Engelsystem\Middleware\ExceptionHandler; -use Engelsystem\Middleware\LegacyMiddleware; -use Engelsystem\Middleware\NotFoundResponse; -use Engelsystem\Middleware\SendResponseHandler; use Psr\Http\Message\ServerRequestInterface; require_once realpath(__DIR__ . '/../includes/engelsystem.php'); @@ -15,13 +11,9 @@ $app = app(); /** @var ServerRequestInterface $request */ $request = $app->get('psr7.request'); +$middleware = $app->getMiddleware(); -$dispatcher = new Dispatcher([ - SendResponseHandler::class, - ExceptionHandler::class, - LegacyMiddleware::class, - NotFoundResponse::class, -]); +$dispatcher = new Dispatcher($middleware); $dispatcher->setContainer($app); $dispatcher->handle($request); -- cgit v1.2.3-54-g00ecf