You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
448B

  1. import axios from "axios";
  2. // config
  3. import { HOST_API } from "config";
  4. // ----------------------------------------------------------------------
  5. const axiosInstance = axios.create({
  6. baseURL: HOST_API,
  7. withCredentials: true,
  8. });
  9. axiosInstance.interceptors.response.use(
  10. (response) => response,
  11. (error) =>
  12. Promise.reject(
  13. (error.response && error.response.data) || "Something went wrong"
  14. )
  15. );
  16. export default axiosInstance;