0
votes

I am using Laravel 5.8 and make a simple API route

Route::get('/test', function () {
    return 'test';
});

But when i access from browser or postman: map-service-api.test/api/test. It returns 404 page I tried dd(123) in api.php file. It worked (browser shows 123). I also tried php artisan route:list the routes api/test also shows. I tried clear cache but it not work. Thank all

1
have you tried map-service-api.test/test ? is this web.php or api.php ?Hamelraj
Could you post your api.php file content?Jared Chu
Could you please provide php artisan route:list here?Dmitry
I wrote in api.php fileDoan Duc

1 Answers

0
votes

If you write this route in web.php then it should be

http://map-service-api.test/test

If you write this route in api.php then it should be

http://map-service-api.test/api/test