setup.sh 571 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. sed -i 's|localhost|'"${DBHOST}"'|g' app.js
  3. export NODE_ENV=production
  4. export NVM_HOME=${IROOT}/nvm
  5. # Used to avoid nvm's return 2 error.
  6. # Sourcing this functions if 0 is returned.
  7. source $NVM_HOME/nvm.sh || 0
  8. nvm install 0.10.8
  9. nvm use 0.10.8
  10. # run app
  11. npm install
  12. node app &
  13. # !DO NOT REMOVE!
  14. #
  15. # It takes `node app` a few seconds to turn on and
  16. # then fork. If you remove this sleep, the parent shell
  17. # executing this script will be terminated before the
  18. # application has time to awaken and be forked, and
  19. # express will fail to be started
  20. sleep 5