Search code examples
node.jssails.jsforever

Sails.js is not working with forever


I m new on both sails.js and node.js. I created a simple api with sails.js. It works fine when I start it with sails lift --prod. On the other hand when I start the application with forever start app.js --prod and it always returns 0 altough I dont not get any error and warning and I can see my app.js in the list with the forever list command. I created a simple node.js application to test forever and it worked as expected. I tried to run my Sails.js application both my local windows and linux/ubuntu machine on digital ocean, they worked fine with sails lift but not forever. Also I tried node app.js --verbose and it was ok. My sails version is 0.11.4. Thanx for your help.


Solution

  • Well eventually I start my application with forever. Those are what I did

    1. I checked forever commands and saw logs command which provides running forever applications log files.
    2. When I checked the log file under c:\users\user-name\forever I saw a warning about Sails migrate settings should have been done.
    3. Then I read this documentation about Sails migrate settings and I set my project as migrte: 'safe' .

    Now it works fine.