In v2 axios
and supertest
has moved to peerDependencies
. If you are using one of these requests see the next instructions:
install supertest package:
npm i -D supertest
install axios package:
npm i -D axios
- if you've used default axios export:
import { axios } from 'rest-chronicle';
const response = await axios({
method : 'GET',
url : `https://example.com/users`,
with : { title: 'List of Users', group: 'Users' }
});
use constructor instead:
import { Axios } from 'rest-chronicle';
const axios = new Axios();
const response = await axios({
method : 'GET',
url : `https://example.com/users`,
with : { title: 'List of Users', group: 'Users' }
});
- if you've used Axios class without chronicle:
import { Axios } from 'rest-chronicle';
const axios = new Axios();
use explicit null
instead:
import { Axios } from 'rest-chronicle';
const axios = new Axios(null);
- if you've used Axios class with explicit chronicle:
import chronicle, { Axios } from 'rest-chronicle';
const axios = new Axios(chronicle);
keep using, without additional interventions
See detailed Changelog for a list of changes.