mongoose supports asynchronous connections using either callbacks or promises. If you pass it a callback function as an argument, it will automatically use that callback. If not, it will default to using a promise.
express.urlencoded() is available in Express v4.16.0 onwards. For earlier versions, you’ll need to install the body-parser package.
There is a json version of this middleware if you’re expecting a form to be submitted using Javascript: express.json(). It performs the same functionality and adds submitted data to req.body.
Open lab-time
Ash’s presentation!
Dailies
Submit today’s Codepen/repo/gist to the Dailies section (in Assessments) in Brightspace.