<?php
declare(strict_types=1); require_once __DIR__ . '/../vendor/autoload.php'; use App\Http\ErrorHandler; use App\Http\Response; use App\Routing\Router; ErrorHandler::register(); $router = new Router(); $registerRoutes = require __DIR__ . '/../src/Http/routes.php'; $registerRoutes($router); $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/'; if (strpos($uri, '/api/') !== 0) { if ($uri === '/' || $uri === '/index.html') { readfile(__DIR__ . '/index.html'); exit; } return false; } $router->dispatch($method, $uri); 