bitpay / node-bitpay-client

A Node.js module and command line client for interacting with BitPay's Cryptographically Secure API
102 stars 95 forks source link

WIP: Allow for ENV vars in config #37

Closed martindale closed 10 years ago

martindale commented 10 years ago

This change allows for config vars; tests still don't pass on a clean install, though (see Travis as a use case).

tacticalchihuahua commented 10 years ago

See https://github.com/bitpay/node-bitpay-client/pull/41

Config should not affect tests, as the tests do not interact with the API. Regarding using ENV vars for config, you can now overload config when creating an instance of the client:

bitpay.createClient(secret, {
  config: {
    apiHost: process.env['bitpay-api-host'],
    apiPort: process.env['bitpay-api-port']
  }
});

Also, check out https://github.com/bitpay/node-bitpay-client/pull/40 which let's you setup preset configurations and switch them out with:

bitpay config --use <preset>

Closing this PR, but if you think there is a legitimate reason to reopen, please do.