dsteem-fallback
Thin wrapper around dsteem with identical API and automated fallback support
Installation
npm i @sweatshop/dsteem-fallback --save
Usage
original dsteem constructor:
import dsteem from 'dsteem';
const client = new dsteem.Client('https://api.steemit.com');
dsteem-fallback constructor:
import dsteem from '@sweatshop/dsteem-fallback';
const client = new dsteem.Client([
'https://api.badunresponsivedomain.com', //this will fail within 5 seconds as defined by timeout property
'https://api.steemit.com'
], {
timeout: 5 * 1000 // optional, defaults to 60s
});
Support
This project is brought to you by @upheaver.
License
MIT