- Published on
A no-fail workflow for starting a Mongo App
- Authors
- Name
- jen chan
npm install express
and latest version of node- Get server running first. Resist urge to write more code without testing
- Make
api
andpublic/app
folders - Make .gitignore to ignore
node_modules
andconfig.js
npm install โ-save-dev
for dependenciesnpm init
to create a package.json- Make a server.js file with routing โ/โ to res.send โhello worldโ
- Make a router.js file to use express/express.Router() to handle get and post requests. Include body.parser
- Test using Postman
- Write a mongo.js file to abstract mongo connection to rest of app
- Write a schema, test it with one key-value pair
- If using mLabs, remove
localhost
and port info frommongo.js
and insert mlab uri in config.js - Test on Postman