Search code examples
node.jsnodemonkoa

automatically reloading Koa server


I've started playing around with Koa, but so far have been unable to find a decent solution for automatically reloading the application upon code changes.

My understanding is that nodemon is the preferred solution in the Node universe, but I'm getting errors due to the --harmony flag (required by Koa):

$ node_modules/.bin/nodemon /path/to/node-unstable/bin/node app.js
/path/to/node-unstable/bin/node --harmony $@
                     ^^^^^^^
SyntaxError: Unexpected identifier
[nodemon] app crashed - waiting for file changes before starting...

Solution

  • node_modules/.bin/nodemon --harmony-generators app.js should be sufficient