apiz-node-client

Node client for apiz

Usage no npm install needed!

<script type="module">
  import apizNodeClient from 'https://cdn.skypack.dev/apiz-node-client';
</script>

README

apiz-node-client

apiz-node-client implements the APIzClient interface for node, based on got, so you can use options of got.

Usage

import { APIz } from 'apiz-ng';
import apizClient from 'apiz-browser-client';

const apiMeta = {
    getBook: {
        url: 'http://www.a.com'
    }
};

const apis = new APIz(apiMeta, {
    client: apizClient({
        beforeRequest: [async options => console.log(options)],
        afterResponse: [response => console.log(response.statusCode)],
        retry: 3
    })
})

beforeRequest and afterResponse are hooks of got.