Spaces:
Paused
Paused
File size: 974 Bytes
5a81b95 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | /**
* 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 };
|