setup.sh 677 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. sed -i 's|mongodb//.*/hello_world|mongodb//'"${DBHOST}"'/hello_world|g' app.js
  3. export NODE_ENV=production
  4. export NODE_HOME=${IROOT}/nvm/v0.11.16
  5. export PATH=$PATH:$NODE_HOME/bin
  6. # run app
  7. npm install
  8. node --harmony app &
  9. # export NODE_HOME=${IROOT}/node-v0.12.0-linux-x64
  10. # export PATH=$PATH:$NODE_HOME/bin
  11. # ${NODE_HOME}/bin/npm install
  12. # ${NODE_HOME}/bin/node --harmony app.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