14 lines
282 B
JavaScript
14 lines
282 B
JavaScript
import { showError } from './utils';
|
|
import axios from 'axios';
|
|
|
|
export const API = axios.create({
|
|
baseURL: process.env.REACT_APP_SERVER ? process.env.REACT_APP_SERVER : '',
|
|
});
|
|
|
|
API.interceptors.response.use(
|
|
(response) => response,
|
|
(error) => {
|
|
showError(error);
|
|
}
|
|
);
|