summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-12 00:08:52 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-19 13:59:57 +0200
commit18fd73a899602a473044013854a354254062ebd4 (patch)
treea5202fe90c8d08e3c7c06579a55074160e7d5463 /public
parentf3b3b6683ca90b70ec4d4daae002dc0caac9ebdd (diff)
Moved middleware to application config
Diffstat (limited to 'public')
-rw-r--r--public/index.php12
1 files changed, 2 insertions, 10 deletions
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);