Skip to content

Instantly share code, notes, and snippets.

@vunb
Last active May 3, 2018 07:22
Show Gist options
  • Save vunb/89ca86992f379dc699fe to your computer and use it in GitHub Desktop.
Save vunb/89ca86992f379dc699fe to your computer and use it in GitHub Desktop.
Run node.js application in production mode
#!/bin/sh
#set enviroment before start script
NODE_ENV=production forever start ./bin/node.js
#Reference
#https://stackoverflow.com/questions/22312671/node-js-setting-environment-variables
#https://stackoverflow.com/questions/9396953/how-can-i-run-node-js-express-in-production-mode-via-sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment