import axios from 'axios';

export const api = axios.create({
  baseURL: import.meta.env.VITE_API_URL || 'http://localhost:3100/api',
  timeout: 15000,
  withCredentials: true,
});

export function errorMessage(error) {
  return error.response?.data?.error || error.message || 'Request failed.';
}
