setup.sh 649 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. sed -i 's|localhost|'"${DBHOST}"'|g' hello.js
  3. sed -i 's|mongodb//.*/hello_world|mongodb//'"${DBHOST}"'/hello_world|g' hello.js
  4. export NODE_ENV=production
  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.10.8
  10. nvm use 0.10.8
  11. npm install
  12. node hello.js &
  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