Restart the application when some file changes

Viewed 1830

In Nest.js application I would like to create some kind of watch which will restart the whole application when some external file changes. Naturally observing a file for changes is an easy part, but I don't have an idea how to trigger restart in Nest.js within the application.

2 Answers

To achieve the expected result, run the application in debug mode using the gebug prefix for example npm run start:debug. To do this, you must have a script in your package.json: "start:debug": "nest start --debug --watch".

Related