A no-fail workflow for starting a Mongo App

Published on
· 1 min read
Author
  1. npm install express and latest version of node
  2. Get server running first. Resist urge to write more code without testing
  3. Make api and public/app folders
  4. Make .gitignore to ignore node_modules and config.js
  5. npm install —-save-dev for dependencies
  6. npm init to create a package.json
  7. Make a server.js file with routing ‘/’ to res.send “hello world”
  8. Make a router.js file to use express/express.Router() to handle get and post requests. Include body.parser
  9. Test using Postman
  10. Write a mongo.js file to abstract mongo connection to rest of app
  11. Write a schema, test it with one key-value pair
  12. If using mLabs, remove localhost and port info from mongo.js and insert mlab uri in config.js
  13. Test on Postman
Back to the blog