a225d28f75
Reduces the amount of duplication and provides a single place where we can configure base URL, crendentials and other headers
17 lines
326 B
JavaScript
17 lines
326 B
JavaScript
import axios from 'axios';
|
|
|
|
import getConfig from './getConfig';
|
|
|
|
const ROOT_URL = getConfig('API_URL');
|
|
|
|
/**
|
|
* Configures an Axios instance with the correct API URL
|
|
*/
|
|
function createClientInstance() {
|
|
return axios.create({
|
|
baseURL: ROOT_URL,
|
|
withCredentials: true
|
|
});
|
|
}
|
|
|
|
export default createClientInstance();
|