const cArgs = require('./index');
// 从每个msg实例获取(此处是模拟)
let args = {
'headers': {
'identification-decode': 'String' // 注意identification解密后字段名改变了,这里需要写成identification-decode
},
'get': null,
'post': {
'url': 'String',
'most': {
'date': 'String',
'context': 'Object',
'user_id': 'Number'
},
'other': 'Array',
'isx': 'Boolean'
}
};
// 解密后req(此处是模拟)
let req = {
'query' : {},
'headers': {
'identification-decode': 'asdfghjkl' // 注意identification解密后字段名改变了
},
'body': {
'url': 'sad',
'most': {
'date': 'abc',
'context': {},
'user_id': 1
},
'other': [],
'isx': true
}
}
cArgs.checkArgs(args, req, function(e, msg){
console.log(e)
console.log(msg)
})
middleware_framework_checkargs
0.0.2 • Public • PublishedReadme
Keywords
nonePackage Sidebar
Install
npm i middleware_framework_checkargs
Weekly Downloads
2
Version
0.0.2
License
ISC