2019-10-29 07:20:54 +00:00
|
|
|
import axios from 'axios';
|
|
|
|
import { APP_BASE_URL } from 'widget/helpers/constants';
|
|
|
|
|
|
|
|
export const API = axios.create({
|
|
|
|
baseURL: APP_BASE_URL,
|
|
|
|
withCredentials: false,
|
|
|
|
});
|
|
|
|
|
2022-06-23 10:18:56 +00:00
|
|
|
export const setHeader = (value, key = 'X-Auth-Token') => {
|
2019-10-29 07:20:54 +00:00
|
|
|
API.defaults.headers.common[key] = value;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const removeHeader = key => {
|
|
|
|
delete API.defaults.headers.common[key];
|
|
|
|
};
|