在express中,为什么app.use函数可以使用路由参数?

时间:2017-04-12 15:01:07

标签: node.js

在快递框架' app.use(' / users',用户);'在app.js中定义,然后使用' get(' /',function(req,res,next){})'在路上,当我搜索localhost时,为什么它可以工作:3000 /用户?

因为我看到本机代码,所以路径始终未定义,如果使用'使用'中间件,这是layer.js https://github.com/expressjs/express/blob/master/lib/router/layer.js#L44

并且我调试路径也是未定义的 enter image description here

0 个答案:

没有答案