I'm trying to learn Laravel (5.3.28) and I'm running into an issue with my very first api route not working. I've followed the Laravel docs and can create a new project and can navigate to the Laravel splash screen indicating it's working. I added the following route to routes/api.php
to test if I can consume the end-point, but I get an error:
routes/api.php
Route::get('foo', function () {
return 'Hello World';
});
error
NotFoundHttpException in RouteCollection.php line 161:
I have a dedicated CentOS box running XAMPP for my web server. the address to hit the end-point is http://10.0.0.200/test/api/public/foo
.
I'm read that my .htaccess
file should be edited, but the few examples I found match what I already have, so I'm a little lost on what to do.
Here is the output for php artisan route:list
:
+--------+----------+----------+------+---------+--------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+----------+------+---------+--------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/foo | | Closure | api |
| | GET|HEAD | api/user | | Closure | api,auth:api |
+--------+----------+----------+------+---------+--------------+