Where I Put My Frontend Application?

Hello!

I developed APIs using Slim 3.

My API Code

Now I have to build frontend for this api. Where I can put this frontend files? Some are suggesting in public folder but there is index.php file already.
So if I made index.html in there so that will generate error. so where and how should i put my frontend?

Is the front end going to be using Slim? If it will, then everything will go through the front controller (index.php) anyway, so just build the routes accordingly.

$app->get('/', // example.com/
$app->get('/contact', // example.com/contact

If it is outside of Slim then Iā€™d probably put your front controller in a directory called API. (Or more likely I would use a different subdomain entirely.)

1 Like