next-parse-request-args
Request arguments parser.
installation
npm install -S @feizheng/next-parse-request-args
usage
import '@feizheng/next-parse-request-args';
// input:
// 1. (config)
// 2. (url)
// 3. (url, config)
// 4. (method, config)
// 5. (method, url, config)
// 6. (method, url, data, config)
// output:
{
url: '/api/v1',
method:'get',
data: { query:1, zx:1 },
headers: {
'Authorization': 'eyJhbGciOiJIUzUxMiJ9',
'Content-Type': 'application/json'
}
}
license
Code released under the MIT license.