Data bite
ES6 simplified class for consuming data from an external service (Either JSONAPI or GraphQL)
Includes several presets for getting up an running quickly with API consumption, including:
Installation
Make sure you have an .env file present in the directory of the root script with the following params (will use the defaults if not)
DATA_TYPE=jsonapiDATA_HOST=domainDATA_PORT=portNumberDATA_PATH=path
NPM
npm i --save data-bite
Yarn
yarn add data-bite
Usage
const Data = ; let preset = 'fortune'; let service = preset; let resource = 'resource-name'; let opts = {}; service;