const isServer = typeof window === "undefined";

const apiUrl = isServer
  ? process.env.SERVER_API_URL || "http://localhost:3000/api"
  : process.env.NEXT_PUBLIC_API_URL || "/api/backend";

const baseUrl = {
  // Main API Endpoint (Backend)
  // Logic: Server uses direct HTTP, Client uses Proxy to avoid Mixed Content
  auth: apiUrl,
  admin: apiUrl,
  core: apiUrl,
};

export default baseUrl;
