Reading/Web/Setting up a node app

From MediaWiki.org
< Reading‎ | Web
Jump to navigation Jump to search
  • Setup an instance using the instructions in Reading/Web/Setting up a staging environment
    • Ensure you set the proxy to look at port 8080
  • The default install is setup with an extremely old version of npm. Follow these instructions to use a newer version (I suggest version 6)
  • Install `forever` this will reboot your node app when the server goes down:
sudo npm install forever -g
  • Set the default node port to 8080. Add this to ~/.profile
    export PORT=8080
    
  • Run the app forever:
    > screen
    > forever app.js > mylog.log &
    [ctrl+a+d]