Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default function Connection(token, baseURL, headers = null) {
- currentConnection = axios.create({
- baseURL: baseURL,
- timeout: 12000,
- headers: {
- 'Accept': 'application/json',
- 'X-Access-Token': currentToken
- }
- });
- currentConnection.interceptors.response.use((response) => {
- return response;
- }, (error) => {
- // Only send the response
- return Promise.reject(error.response);
- });
- return currentConnection;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement