setup.sh 681 B

123456789101112131415161718192021222324252627
  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 NODE_HOME=${IROOT}/nvm/v0.10.8
  6. export PATH=$PATH:$NODE_HOME/bin
  7. npm install
  8. node hello.js &
  9. # export NVM_HOME=${IROOT}/nvm
  10. # source $NVM_HOME/nvm.sh
  11. # nvm install 0.10.8
  12. # nvm use 0.10.8
  13. # # run app
  14. # npm install
  15. # node app &
  16. # !DO NOT REMOVE!
  17. #
  18. # It takes `node app` a few seconds to turn on and
  19. # then fork. If you remove this sleep, the parent shell
  20. # executing this script will be terminated before the
  21. # application has time to awaken and be forked, and
  22. # express will fail to be started
  23. sleep 5