'dashboard.php', '/dashboard' => 'dashboard.php', '/dashboard.php' => 'dashboard.php', '/lab' => 'lab.php', '/lab.php' => 'lab.php', '/health' => 'health.php', '/health.php' => 'health.php', '/api/rooms' => 'api/rooms.php', '/api/rooms.php' => 'api/rooms.php', '/api/join' => 'api/join.php', '/api/join.php' => 'api/join.php', '/api/stats' => 'api/stats.php', '/api/stats.php' => 'api/stats.php', ]; $target = $routes[$uri] ?? null; if ($target && is_file(__DIR__ . '/' . $target)) { require __DIR__ . '/' . $target; exit; } /* Static assets under /assets/ */ if (str_starts_with($uri, '/assets/')) { $file = __DIR__ . $uri; if (is_file($file)) { $ext = pathinfo($file, PATHINFO_EXTENSION); $types = ['js' => 'application/javascript', 'css' => 'text/css']; header('Content-Type: ' . ($types[$ext] ?? 'application/octet-stream')); readfile($file); exit; } } http_response_code(404); header('Content-Type: application/json'); echo json_encode(['ok' => false, 'error' => 'not found']);