<?php
// Dev router for PHP built-in server (php -S). Mimics typical .htaccess rewrites.
// Usage: php -S localhost:8000 router.php

$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/');
$path = __DIR__ . $uri;

// Let the built-in server handle existing files (assets, uploads, etc.)
if ($uri !== '/' && is_file($path)) {
    return false;
}

// Otherwise route everything to the front controller
require __DIR__ . '/index.php';
