-
-
Save EvanHahn/e9dedbc01cadacc7295542bf47f7faed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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