/** * CENTRAL API CONFIGURATION * * This is the SINGLE SOURCE OF TRUTH for API endpoints. * DO NOT hardcode localhost ports anywhere else in the codebase. * * Backend runs on port 3001 * Frontend runs on port 8080 */ // Backend API URL - Always port 3001 export const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001'; // WebSocket URL - Always port 3001 export const WS_URL = import.meta.env.VITE_WS_URL || 'ws://localhost:3001'; // MCP WebSocket endpoint export const MCP_WS_URL = `${WS_URL}/mcp`; // Helper to construct full API URLs export const apiUrl = (path: string) => `${API_URL}${path.startsWith('/') ? path : `/${path}`}`; // Helper to construct WebSocket URLs export const wsUrl = (path: string) => `${WS_URL}${path.startsWith('/') ? path : `/${path}`}`; // Port constants for documentation export const PORTS = { BACKEND: 3001, FRONTEND: 8080, } as const; export default { API_URL, WS_URL, MCP_WS_URL, apiUrl, wsUrl, PORTS };