summaryrefslogtreecommitdiff
path: root/public/index.php
blob: 88e57252cd604c21d5f44f2ddb3c064e84373db3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

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');

/** @var Application $app */
$app = app();

/** @var ServerRequestInterface $request */
$request = $app->get('psr7.request');

$dispatcher = new Dispatcher([
    SendResponseHandler::class,
    ExceptionHandler::class,
    LegacyMiddleware::class,
    NotFoundResponse::class,
]);
$dispatcher->setContainer($app);

$dispatcher->handle($request);