export const getApiUrl = () => {
  const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
  
  if (!baseUrl) {
    throw new Error('API base URL is not configured');
  }

  // Remove trailing slash if present
  return baseUrl.replace(/\/$/, '');
};

export const getApiEndpoint = (endpoint: string) => {
  const baseUrl = getApiUrl();
  // Remove leading slash if present
  const cleanEndpoint = endpoint.replace(/^\//, '');
  return `${baseUrl}/${cleanEndpoint}`;
}; 