I have start server by this cmd in the console, and it is working fine
php -S localhost:8000 -t public
When i call the API in postman for the lumen like this:
localhost:8000/GitHub/twinfield/public/index.php/user
The API work for insert but when i call like this:
localhost:8000/GitHub/twinfield/user
The error is given below:
(1/1) NotFoundHttpException in RoutesRequests.php (line 226) at Application->handleDispatcherResponse(array(0)) in RoutesRequests.php (line 164) at Application->Laravel\Lumen\Concerns{closure}() in RoutesRequests.php (line 413) at Application->sendThroughPipeline(array(), object(Closure)) in RoutesRequests.php (line 166) at Application->dispatch(null) in RoutesRequests.php (line 107) at Application->run() in index.php (line 28)
My routes file in routes/web.php:
$router->get('/', function () use ($router) {
//print_r('1234');die;
return $router->app->version();
});
$router->get('user','userController@index');
$router->get('user/{id}','userController@getuser');
$router->post('user','userController@createuser');
$router->post('user/{id}','userController@updateuser');
$router->delete('user/{id}','userController@deleteuser');
I have already try to solve like this in public/index.php without success.
$request = Illuminate\Http\Request::capture();
$app->run($request);
I am working in localhost with Xampp. The database is MySQL and PHP version is 7.1.