You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
253 B

3 months ago
  1. exports.request = {
  2. get (url, opts) {
  3. // lazy require
  4. const fetch = require('node-fetch')
  5. const reqOpts = {
  6. method: 'GET',
  7. timeout: 30000,
  8. ...opts
  9. }
  10. return fetch(url, reqOpts).then(result => result.json())
  11. }
  12. }