setup.sh 821 B

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