# req.route

包含当前匹配的路由,一个字符串。

# 概要

req.route

# 描述

包含当前匹配的路由,一个字符串。例如:

app.get('/user/:id?', (req, res) => {
  console.log(req.route)
  res.send('GET')
})

上一个片段的示例输出:

+

关注公众号,获取验证码 !

验证码:
Last Updated: 6/17/2023, 6:57:19 PM