My Express web server is very basic and includes the following code:
var app = module.exports = express.createServer();
app.get('/:user', function(req, res) {
console.log('GET');
});
app.param('user', function(req, res, next, id) {
console.log('PARAM');
next();
});
app.listen(3000);
Whenever I navigate to http://localhost:3000/MyName
, I notice that the console displays the output twice:
PARAM
GET
PARAM
GET
I am curious as to why this behavior is occurring. Can anyone explain?