【发布时间】:2016-07-13 12:44:10
【问题描述】:
我需要为以下网址创建快速路由: www.somesite.com/some-text-goes-here-id
在这种情况下,我想要参数: 文字:一些文字在这里 身份证:身份证
官方文档说明了以下示例:
Route path: /flights/:from-:to
Request URL: http://localhost:3000/flights/LAX-SFO
req.params: { "from": "LAX", "to": "SFO" }
但是在我的情况下,我需要有多个'-',并且只有最后一个应该是 id ...
这就是例子
Route path: /flights/???
Request URL: http://localhost:3000/flights/some-text-goes-here-123
req.params: { "from": "some-text-goes-here", "to": "123" }
我不确定是否可以这样做?
谢谢
【问题讨论】: