<?php
declare(strict_types=1);

date_default_timezone_set((string) config('app.timezone', 'UTC'));

use App\Core\Request;
use App\Core\Router;
use App\Core\Session;

Session::start();
Session::ageFlash();
\App\Core\Auth::instance();

if (!headers_sent()) {
    header('X-Content-Type-Options: nosniff');
    header('X-Frame-Options: SAMEORIGIN');
    header('Referrer-Policy: strict-origin-when-cross-origin');
}

$request = new Request();
$router = new Router();
$register = require APP_PATH . '/routes.php';
$register($router);
$router->dispatch($request);
