import axios from "axios";

const CDNCallAxios = axios.create({
  baseURL: "http://localhost:4000",
  withCredentials: true,
});

CDNCallAxios.interceptors.request.use(
  (config) => {
    return config;
  },
  (error) => Promise.reject(error),
);

CDNCallAxios.interceptors.response.use(
  (res) => res,
  (error) => Promise.reject(error),
);

const CDNCall = {
  get: CDNCallAxios.get,
  post: CDNCallAxios.post,
  put: CDNCallAxios.put,
  patch: CDNCallAxios.patch,
  delete: CDNCallAxios.delete,
};

export default CDNCall;
