Serving an frontend build folder on an backend server made with Adonisjs

Hello my friends,

I found a way to rendering a web frontend on an backend server made with Adonis. This is ideal for anyone who wants to publish a small web application.

In file start/kernel.js uncomment the ‘Adonis/Middleware/Static’ line and copy the frontend build into the adonis public folder.

Now is just go to access adress

and the frontend will load.

Hey @ronefel! :wave:

Note that this middleware is commented by default on API & Slim blueprint because it kills performance.

It’s way better to properly host any kind of frontend assets in a CDN or serve them as static assets by your web server (Apache, Nginx, etc.)

Hi @romain.lanz,

I agree with you. In a web application with many access, this is far from ideal.

But what I have presented here is for those who are developing their first application and just want to see the your work online without complexity and at low cost.