Laravel route with error 404

Asked

Viewed 149 times

-1

I am working on an implementation with React and Node (services), but the API is in Laravel. To bring information from the database I needed to create a route, in a preconfigured group.

But when I go to test the route he gives me a 404.

I tried some approaches and tried to look for similar documents and issues that could help me, without success.

Follows the code:

Route::group(['prefix' => 'areas'], function () {
Route::post('/',                'AreasLayersController@index')->middleware('auth_acl:can-web-search-areas');
Route::post('/points',          'AreasLayersController@interestPoints')->middleware('auth_acl:can-web-search-areas');
Route::post('/points/natures',  'AreasLayersController@interestPointsNatures')->middleware('auth_acl:can-web-search-areas');

Route::post('/points-by-customer', 'AreasLayersController@customerInterestPoints')->middleware('auth_acl:can-web-search-areas');
Route::post('/points/natures-by-customer', 'AreasLayersController@customerInterestPointsNatures')->middleware('auth_acl:can-web-search-areas');
Route::post('/public-entity-points', 'AreasLayersController@publicEntityPoints')->middleware('auth_acl:can-web-search-areas');
Route::get('/public-entities', 'AreasLayersController@publicEntityType')->middleware('auth_acl:can-web-search-areas');  

Route::get('/information/types', 'AreasLayersController@areaInformationTypes')->middleware('auth_acl:can-web-search-areas');

});

All routes work correctly, except the route I created: 'information/types' with proper implementations (controller and service)

PS. I have created a route in India that directly accesses the microservice and I have the expected response. Missing really make the route in the API work.

If you can shed some light, thank you. I keep trying while.

Another observation: we are using ngnix. I even restarted the server completely to see if it identified the changes and nothing :/

1 answer

-1


I solved the personal problem.

In case I needed to call the command php Artisan optimize to reset the cache of settings, routes and files.

Success! D

  • 1

    In development the recommendation is not to cache configs, use the .env. file settings. env, I’ve seen too much cloud system with . env open to the world

Browser other questions tagged

You are not signed in. Login or sign up in order to post.