request.js 312 B

12345678910111213141516
  1. exports.request = {
  2. get (uri, opts) {
  3. // lazy require
  4. const request = require('util').promisify(require('request'))
  5. const reqOpts = {
  6. method: 'GET',
  7. timeout: 30000,
  8. resolveWithFullResponse: true,
  9. json: true,
  10. uri,
  11. ...opts
  12. }
  13. return request(reqOpts)
  14. }
  15. }