Through the composer, I started a project with the command:
composer create-project --prefer-dist laravel/laravel api
After the installation of the dependencies, I was able to see the "welcome" of the application (through the default wheel that is already created at project start time).
In the wheel file, within the route
directory the web.php
file exists the code:
Route::get('/', function () {
return view('welcome');
});
So far so good, even though the application was created correctly, but I'm not interested in doing the web application for laravel, I just want to use the laravel of api, for that:
Inside the route
directory in the api.php
file:
Route::get('/', function () {
return 'API';
});
Should be the routes for access to api, however regardless of the route I configure in this file (api.php) is not processed by the application, the following error is displayed when I access the http://localhost/api/public/api
link:
What can I have done wrong, why can not I access the api routes?