我正在使用Express Gateway获取web应用程序的SSL urls。
网关接收url,通过删除双斜杠等来清除它。
https://server:port/aaaa/bbbb//cccc变成了https://server:port/aaaa/bbbb/cccc。
这样做的问题是我们的应用程序不能识别url/命令。
有没有办法让url保持原样?
发布于 2020-01-16 21:36:53
根据express文档:
https://expressjs.com/en/5x/api.html#express.router
您可以传递到路由器选项。传递strict: true将启用严格的路由。
所以这样创建你的路由器:
const router = express.Router({
strict: true
});
...
...
module.exports = router;https://stackoverflow.com/questions/59770722
复制相似问题