【发布时间】:2012-08-20 08:20:45
【问题描述】:
我有一个非常基本的 Express 网络服务器:
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);
当我运行http://localhost:3000/MyName 时,我的控制台中有以下输出:
PARAM
GET
PARAM
GET
为什么我每个输出都得到两次?
【问题讨论】:
标签: javascript express