1
Intent:
access http://localhost/api/users/[action]
created the route
Router::scope('/api', function (RouteBuilder $routes) {
$routes->extensions(['json']);
$routes->resources('Usuarios');
});
is working, but when I access the address http://localhost/users/[action] works the same way, I don’t want this address to be available, just the /api address
filing cabinet 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();