【发布时间】:2020-03-26 13:21:58
【问题描述】:
我想在获取服务中验证我的参数。
我的网址就像 /tableref?param1¶m2
我的代码是这样的
app.get('/tableref\?:event&:queryObject', [
check('event').isLength({ min: 5, max:15 }),
check('queryObject').isLength({ max: 5, max:35 })
] , function(req, res) {...})
但我遇到了 404 错误。
我想使用 express-validator 来检查我的参数。 之前,我的代码是
app.get('/tableref', function(req, res) {...})
如何使用 get query 检查我的参数?提示
【问题讨论】:
标签: javascript node.js express express-validator