using async await in expressjs middleware code example
Example: expressjs4 async
app.post('/signup', async(req, res, next) => {
async function runAsync () {
await firstThing()
await secondThing()
}
runAsync()
.catch(next)
})
app.post('/signup', async(req, res, next) => {
async function runAsync () {
await firstThing()
await secondThing()
}
runAsync()
.catch(next)
})