CoinGecko-API icon indicating copy to clipboard operation
CoinGecko-API copied to clipboard

Allow overriding https.request options

Open oxycodon opened this issue 4 years ago • 0 comments

Adds to class CoinGecko an optional argument 'processRequestOptions', which is a function that can alter https.request options. Useful for tweaking things like the request timeout.

Example usage:

const CoinGecko = require('./lib/CoinGecko');

(async () => {
  const processRequestOptions = (opts) => {
    opts.port = 444;
    return opts;
  };

  const CG = new CoinGecko({ processRequestOptions });

  await CG.coins.list();
})();

oxycodon avatar Feb 22 '21 00:02 oxycodon