'ok', 'panel' => 'NovaCPX', 'version' => NOVACPX_VERSION]); } // Public endpoints (no auth required) $public = ['auth']; if (!in_array($endpoint, $public)) { $auth = Auth::getInstance(); if (!$auth->check()) { Response::error('Unauthorized', 401); } $currentUser = $auth->user(); } // Route to endpoint handler $endpointFile = NOVACPX_API . "/endpoints/{$endpoint}.php"; if (!file_exists($endpointFile)) { Response::error("Unknown endpoint: $endpoint", 404); } require $endpointFile;