setup.sh 641 B

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