'Unknown route', 'available' => array_map(fn($r) => "/api/{$r}", $validRoutes), 'docs' => [ 'POST /api/register' => 'Create a new user site. Body: {"username":"alice"}', 'POST /api/upload' => 'Upload files. Form data: username + files[]', 'POST /api/save' => 'Save file from editor. Body: {"username":"alice","filepath":"index.php","content":"..."}', 'GET /api/file' => 'Get file content. Params: ?username=alice&filepath=index.php', 'GET /api/files' => 'List all files. Params: ?username=alice', 'POST /api/delete' => 'Delete file or site. Body: {"username":"alice","filepath":"index.php"} or {"username":"alice","delete_all":true}', 'GET /api/stats' => 'Disk usage and user count', 'GET /site/username/file' => 'View a user site e.g. /site/alice/index.php', ] ]); exit; } // ── Route to the correct file ───────────────────────────────────────────────── require_once __DIR__ . "/{$route}.php";