Not found page in Lumen after install

Sky picture Sky · Jun 17, 2015 · Viewed 9.8k times · Source

I just installed Lumen but when I head to its public directory localhost/lumen/public,

Sorry, the page you are looking for could not be found.

will appear.

I checked app\Http\routes.php and changed

$app->get('/', function () use ($app) {

to

$app->get('/lumen/public/', function () use ($app) {

And it worked.

But this is not the thing I want. In Laravel the '/' works perfectly. How can I make Lumen work with '/'?


BTW when I use php artisan serv, '/' works but only in artisan serv :(

Answer

Sky picture Sky · Aug 9, 2015

One Way:

In /public/index.php change

$app->run();

to

$app->run($app['request']);

Another Way:

This also works too (faster):

$app->run($app->make('request'));