Jordy8's avatar

Lumen in subdirectory

Hello! I want to add Lumen in a subdirectory to serve my main Laravel application (a game). The reason I don't want it as a subdomain is because my Laravel has different subdomains (like server1.example.com or server2.example.com). So my API should be callable from server1.example.com/data instead of api.server1.example.com)

How can I do this? Thank you!

0 likes
1 reply
ChristophAust's avatar

Put the public folder into the subfolder and edit the index php, to include bootstrap from the right location:

$app = require __DIR__.'/../bootstrap/app.php';

This you could change to

$app = require __DIR__.'/../../bootstrap/app.php';

I have not tried it but it should work.

Please or to participate in this conversation.