Chimu
Searchโ€ฆ
๐Ÿš€
Quick start
1
import chimuApi from 'chimu-api/dist/api.js'
Copied!
Or use as module
1
import chimuApi from 'chimu-api/dist/api.mjs'
Copied!

Example GET Request

1
const config = {
2
baseURL: 'https://app.example.com',
3
};
4
โ€‹
5
const Api = new chimuApi(config);
6
โ€‹
7
export const GET_LIST = 'GET_LIST';
8
export const GET_LIST_SUCCESS = 'GET_LIST_SUCCESS';
9
export const GET_LIST_FAILURE = 'GET_LIST_FAILURE';
10
โ€‹
11
const getList = {
12
type: GET_LIST,
13
payload: {},
14
params: {},
15
meta: {
16
method: 'get',
17
path: '/list',
18
},
19
};
20
โ€‹
21
Api.one(getList).then(resp => {
22
if (resp.status === GET_OFFERS_SUCCESS) {
23
console.log('Success', resp.data);
24
}
25
return resp.status;
26
});
27
โ€‹
28
โ€‹
Copied!
Copy link