<?php

declare(strict_types=1);

require_once __DIR__ . '/vendor/autoload.php';

use App\core\Router;
use App\Controllers\HomeController;
use App\Controllers\NewsController;
use App\Controllers\CategoryController;

$router = new Router();

$router->get('/', [HomeController::class, 'index']);
$router->get('/noticia/{slug}', [NewsController::class, 'show']);
$router->get('/{slug}', [CategoryController::class, 'index']);

$method = $_SERVER['REQUEST_METHOD'];
$uri = $_SERVER['REQUEST_URI'] ?? '/';

$router->dispatch($method, $uri);
