# req.route
包含当前匹配的路由,一个字符串。
# 概要
req.route
# 描述
包含当前匹配的路由,一个字符串。例如:
app.get('/user/:id?', (req, res) => {
console.log(req.route)
res.send('GET')
})
上一个片段的示例输出:
+ 
关注公众号,获取验证码 !
验证码:
← req.res req.secure →
包含当前匹配的路由,一个字符串。
req.route
包含当前匹配的路由,一个字符串。例如:
app.get('/user/:id?', (req, res) => {
console.log(req.route)
res.send('GET')
})
上一个片段的示例输出:
← req.res req.secure →