Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const connect = require('./')
const app = connect()
app.use((req, res, next) => {
console.log('In middleware 1')
next()
})
app.use((req, res, next) => {
console.log('In middleware 2')
next(404)
})
app.use((err, req, res, next) => {
console.log('In error middleware. Error is a(n)', typeof err)
res.end('Error!')
})
app.listen(3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment