Created
November 9, 2016 05:00
-
-
Save ayushgp/4e6748e5edc6b97d041c066dadc9e066 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
// First middleware | |
app.use(function(req, res, next){ | |
console.log("Started"); | |
next(); | |
}); | |
// Route handler | |
app.get('/', function(req, res, next){ | |
res.send("Sent to client"); | |
next(); | |
}); | |
// Last middleware | |
app.use('/', function(req, res){ | |
console.log("Ended"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment