I have a SailsJS app set up on a Webfaction server. Everything works nicely (site can be accessed through browser, console works) when I run the app via any of the following commands, with and without the --prod
param:
sails console
,
sails lift
,
node app.js
However, when I try to run the app with forever using forever app.js
I get a 502 error, as if nodejs server isn't even running. When I run forever list
I can see app.js listed among running processes.
How can I have my app run with forever?
I managed to solve this issue; the problem occurred due to SailsJS migration prompt which shows up when you start the server. Running app.js with forever worked, but the server didn't start because the script hanged waiting for a prompt reply. If you encounter this issue just make sure you have your migrate option set in model config to avoid running into migration prompt.