import { domain } from "@/app/domain";
import axios from "axios";

// Check if running on the client side
const baseURL =
  typeof window !== "undefined"
    ? `${window.location.origin}/` // Client-side base URL
    : `https://${domain}/`; // Fallback for server-side (replace with your actual domain)

const axiosInstance = axios.create({
  baseURL: baseURL,
  // headers: {
  //   "X-API-KEY": "3064c564d11154da943a1fd968822b6c",
  //   "Content-Type": "application/json",
  // },
  // withCredentials: true, // Enable credentials
});

export default axiosInstance;
