'auth/login.php', 'POST /auth/refresh' => 'auth/refresh.php', 'POST /auth/logout' => 'auth/logout.php', 'GET /auth/me' => 'auth/me.php', 'GET /health' => 'health.php', ]; $routeKey = $method . ' ' . $path; if (isset($routes[$routeKey])) { $handlerPath = $rootDir . '/api/endpoints/' . $routes[$routeKey]; if (file_exists($handlerPath)) { require $handlerPath; } else { api_error('Endpoint not implemented', 501); } } else { api_error('Not found', 404); }