Tired of having to restart your NodeJS application after each JS change? No more! 8)
I am doing some testing on my server with a socket.io application and, in order to coolaborate easily, I configured a WebHook on my GitHub repository in order to auto-update the code. This was solving the initial problem: how to update the code without sharing access to the server but there was still one other issue: how to restart the NodeJS app after a code update. First I was thinking on saving the PID of the runnin app into a file and let the pull script to do the magic, but then I thought “hey, I am not the first want willing to do it!” so a little search on Google brought the magic to my eyes: node-supervisor.
Really simple to install and to use, in my case it is just:
supervisor -w .,controllers,models app.js >> /var/log/some-log-file.log
Obviously you can do the same trick on your testing or local environment, so, what are you waiting to forget about the Ctrl+C ?