Problems with the microframework lumen

If you just want to build an api server, don't want to use laravel, but want to use a more lightweight lumen.

When you do nothing but publish it to a sub domain of apache, after opening the home page, you find that the route cannot be found? !

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

1/1NotFoundHttpException in RoutesRequests.php line 596:

  1. in RoutesRequests.php line 596
  2. at Application->handleDispatcherResponse(array('0')) in RoutesRequests.php line 533
  3. at Application->Laravel\Lumen\Concerns\{closure}() in RoutesRequests.php line 785
  4. at Application->sendThroughPipeline(array(), object(Closure)) in RoutesRequests.php line 535
  5. at Application->dispatch(null) in RoutesRequests.php line 476
  6. at Application->run() in index.php line 29

To be honest, this cannot be considered a bug, because lumen does not consider the sub domain in the processing of the path.

The corresponding method is to process the request first, extract the correct path from the request, and then hand it over to the app to match the route.

Modify the file ./public/index.php

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

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326613377&siteId=291194637