Nodemon is a great tool to restart your Node.js server upon changes to source code. Usually it works great, but today it was acting up and after spending a half hour trying to fix, I thought, F-it, this shouldn’t be that hard to write from scratch.
If you have similar problems, try this out. Will probably turn this into yet another NPM module.
I recommend taking this file, putting it in the root of your project, and calling it “dev-server.js”.
You can run it with ./dev-server.js, since it has the hashbang.
I did write an NPM module. I think anyone interested should just use the above script and make it their own, but if you want to see what it looks like as an NPM module, it’s a little less sleek because it has to be more generic: