Axios-pool
Install
npm install @coxy/axios-pool
Create pool
import { createAxiosPool } from '@coxy/axios-pool';
... or using CommonJS syntax:
const { createAxiosPool } = require('@coxy/axios-pool');
Params
value | type | default value |
---|---|---|
sendAll | boolean | true |
timeout | number | 0 |
...instances | AxiosInstance or string |
const instance = axios.create({ baseUrl: 'https://yahoo.com' })
const pool = createAxiosPool({sendAll: false}, 'https://google.com', instance);
const { data } = await pool.get('/')
console.log(data)