serve static assets with Nest.js

How to serve static files with NestJS

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 assets with Nest.js?