setup.sh 612 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. sed -i 's|mongodb://.*/hello_world|mongodb://'"${DBHOST}"'/hello_world|g' app.js
  3. sed -i 's|localhost|'"${DBHOST}"'|g' app.js
  4. export NODE_ENV=production
  5. export NODE_HOME=${IROOT}/nvm/v0.10.8
  6. export PATH=$PATH:$NODE_HOME/bin
  7. # run app
  8. npm install
  9. node app &
  10. # ${NODE_HOME}/bin/npm install
  11. # ${NODE_HOME}/bin/node app &
  12. # !DO NOT REMOVE!
  13. #
  14. # It takes `node app` a few seconds to turn on and
  15. # then fork. If you remove this sleep, the parent shell
  16. # executing this script will be terminated before the
  17. # application has time to awaken and be forked, and
  18. # express will fail to be started
  19. sleep 5