Intention:
access link
I created the route
Router::scope('/api', function (RouteBuilder $routes) {
$routes->extensions(['json']);
$routes->resources('Usuarios');
});
is working, but when I access the address link works the same way, I do not want this address to be available, just the / api address
file routes.php
Router::defaultRouteClass('DashedRoute');
Router::scope('/', function (RouteBuilder $routes) {
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
$routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);
$routes->fallbacks('DashedRoute');
});
//essa é a rota que eu criei
Router::scope('/api', function (RouteBuilder $routes) {
$routes->extensions(['json']);
$routes->resources('Usuarios');
});
Plugin::routes();