Chatwoot/app/javascript/widget/helpers/axios.js
Pranav Raj S 16fe912fbd
[Feature] Website live chat (#187)
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2019-10-29 12:50:54 +05:30

15 lines
349 B
JavaScript
Executable file

import axios from 'axios';
import { APP_BASE_URL } from 'widget/helpers/constants';
export const API = axios.create({
baseURL: APP_BASE_URL,
withCredentials: false,
});
export const setHeader = (key, value) => {
API.defaults.headers.common[key] = value;
};
export const removeHeader = key => {
delete API.defaults.headers.common[key];
};