setup.sh 461 B

123456789101112131415161718
  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. fw_depends nodejs
  5. npm install
  6. node app &
  7. # !DO NOT REMOVE!
  8. #
  9. # It takes `node app` a few seconds to turn on and
  10. # then fork. If you remove this sleep, the parent shell
  11. # executing this script will be terminated before the
  12. # application has time to awaken and be forked, and
  13. # express will fail to be started
  14. sleep 5