lundi 14 novembre 2016

How to route to a static folder and serve html contents within that folder ?

I am beginner in laravel & trying to serve html contents through route. the contents are about api documentation so i want to serve it through route. the documetation contains in /doc with following directory structure.

/laravel_project
  .
  .
  doc/
   .
   .
   index.html

i want to serve this contents on following route:

Route::get('/apiDoc', function () {

    return File::get(public_path() . '/doc/index.html');

});

I tried like above but it is not working. please help me with same how can i serve this contents

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire