A no-fail workflow for starting a Mongo App
- Published on
- Author
-
npm install expressand latest version of node- Get server running first. Resist urge to write more code without testing
- Make
apiandpublic/appfolders - Make .gitignore to ignore
node_modulesandconfig.js npm install —-save-devfor dependenciesnpm initto 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
localhostand port info frommongo.jsand insert mlab uri in config.js - Test on Postman