<?php

declare(strict_types=1);

ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

use System\Http\Request;
use System\Http\Response;
use System\Routing\Dispatcher;
use System\Routing\Router;

$app = require dirname(__DIR__) . '/bootstrap/app.php';

$router = $app->container()->make(Router::class);
$request = $app->container()->make(Request::class);
$response = $app->container()->make(Response::class);
$dispatcher = $app->container()->make(Dispatcher::class);

require ROUTES_PATH . '/web.php';

$dispatcher->dispatch(
    $router,
    $request,
    $response
);