import axios from "axios";

const publicApiInstance = axios.create({
  baseURL: 'http://localhost:3500/api/v1',
  withCredentials: true,
});

publicApiInstance.interceptors.request.use(
  (res) => res,
  (err) => Promise.reject(err)
);

publicApiInstance.interceptors.response.use(
  (res) => res,
  async (err) => Promise.reject(err)
);

const publicApi = {
  post: publicApiInstance.post,
  get: publicApiInstance.get,
  put: publicApiInstance.put,
  delete: publicApiInstance.delete,
};

export default publicApi;
