Keep your Node.js scripts running with Forever and Nodemon [TODO:TRANSLATE]



Nodemon is a utility that will monitor for any changes in your source and automatically restart your server.  Install with npm:

npm install -g nodemon

Forever is a simple CLI tool for ensuring that a given script runs continuously (i.e. forever). Install with npm:

npm install -g forever

Now you can use:

Forever -w app.js

Or Forever & Nodemon running together:

forever start nodemon --exitcrash app.js


Error resolve:

If you get an error like this:

error:   Cannot start forever
error:   script /home/nikola/nodemon does not exist.

Try to run nodemon with the full path:

forever start /usr/bin/nodemon --exitcrash app.js

You can find out the path to nodemon by executing:

which nodemon

Fuente:
http://www.nikola-breznjak.com/blog/nodejs/keep-your-node-js-scripts-running-with-forever-and-nodemon/

0 Comentarios

Publicar un comentario