Created
November 9, 2016 04:32
-
-
Save ayushgp/7c21ff7a602d477e7f12e8ff06597f59 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
var app = require('express')(); | |
function logger(req, res, next){ | |
console.log("A %s request was received at %s", req.method, req.url); | |
next(); | |
} | |
// Use the middleware function | |
app.use(logger); | |
app.get('/', function(req, res){ | |
res.send("Hello World!"); | |
}); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment