Auto reloading a Sails.js app on code changes?

You have to use a watcher like forever, nodemon, or something else…

Example

  1. Install forever by running:

    sudo npm install -g forever

  2. Run it:

    forever -w start app.js


To avoid infinite restart because Sails writes into .tmp folder, you can create a .foreverignore file into your project directory and put this content inside:

**/.tmp/**
**/views/**
**/assets/**

See the issue on GitHub:
Forever restarting because of /.tmp.

Leave a Comment

tech