getRoutes(); foreach($routes as $method => $methodRoutes) { echo "\n$method routes:\n"; foreach($methodRoutes as $path => $handler) { if(strpos($path, '/api/') === 0) { echo "- $path -> " . (is_array($handler) ? $handler[0] . '::' . $handler[1] : 'Closure') . "\n"; } } } echo "\nTesting route match for /api/users/roles:\n"; $match = $router->match('GET', '/api/users/roles'); if($match) { echo "Route found: " . print_r($match, true) . "\n"; } else { echo "No route found\n"; }