In express framework 'app.use('/users', users);' defined in app.js and then use 'get('/', function(req, res, next){})' in route, why it can work when I search localhost:3000/users ?
Because I see native code , the path is always undefined, if use 'use' middleware, this is layer.js https://github.com/expressjs/express/blob/master/lib/router/layer.js#L44 and also I debug the path is also undefined
via ZHONGJIAFENG
No comments:
Post a Comment