0

I am using

Lumen Version: 6.0.3
PHP Version: 7.3.0
Database Driver & Version: MySQL
Description: I am creating API for my application in the lumen as backend. But after test with postman, I am getting response NotFoundHttpException.

This is my routes

$router->get('/', function () use ($router) {
    return $router->app->version();
});

// public routes
$router->group(['prefix' => 'api/v1'], function () use ($router) {

    $router->post('register', 'UsersController@register');
    $router->post('login', ['uses'=>'AuthController@authenticate']);

});

// auth routes
$router->group(['prefix' => 'api/v1/auth', 'middleware'=>'jwt'], function () use ($router) {

    $router->post('create-course', 'CourseController@create_course');

});

I have also tried this solution but failed to run my application. Please follow the link:

NotFoundHttpException with Lumen

Help will be appreciated.

aynber
  • 22,380
  • 8
  • 50
  • 63
Sahadev
  • 1,368
  • 4
  • 18
  • 39
  • Which route are you trying to access, and with GET or POST? – aynber Sep 27 '19 at 15:20
  • with every route, i'm getting this exception. – Sahadev Sep 27 '19 at 15:22
  • what webserver are you using? – Zenel Rrushi Sep 27 '19 at 15:55
  • 1
    This could have 20 different causes. Just type `php artisan route:list` (not sure if this works for Lumen) and it should list your routes. If it doesnt work, go check your `RouteServiceProvider` how your routes are being loaded (i.e. middleware or prefix settings). – Flame Sep 27 '19 at 17:29

0 Answers0