import axios from 'axios' export interface ApiEnvelope { success: boolean data?: T error?: string } export const http = axios.create({ baseURL: '/api', timeout: 15000, }) http.interceptors.request.use((config) => { const token = localStorage.getItem('token') if (token) { config.headers = config.headers ?? {} config.headers.Authorization = `Bearer ${token}` } return config })