If you are developing a web app with Nest.js as the backend. And now, you want to deploy your whole app into a single server. Then you may run into a problem of serving static assets. Especially if your frontend is a SPA. Fear not, there are multiple ways to achieve this, so how to serve static files with NestJS?

In short, we achieve this by using the express.static method inside our Nest App. And pass the assets folder to our method params.

#nestjs #express.js #javascript #nest.js #node.js

How to serve static files with NestJS
155.15 GEEK