1

I was getting tired of using FileZilla every time I wanted to push a change to my server hosting my website and so I set up a github repo and linked it to my server so that changes and pushed right to the server.

However, my backend is written in node and so each time I update my server.js file I have to restart the server. With "node server.js"

Is there a way to watch the file and programmatically restart the node server when an update is detected?

If it helps, my serve is Ubuntu Linux running apache2

frankgreco
  • 1,426
  • 1
  • 18
  • 31

1 Answers1

1

You could try writing something yourself, or use one of the popular libraries that are already out there:

Wex
  • 15,539
  • 10
  • 64
  • 107