fix: Update WebSocket and API URLs to use environment variables for better configuration
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
const WS_URL = 'ws://localhost:3002';
|
||||
const API_URL = 'http://localhost:3001';
|
||||
// Use environment variables or fallback to relative URLs for proxy
|
||||
const WS_URL = import.meta.env.VITE_WS_URL || `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws`;
|
||||
const API_URL = import.meta.env.VITE_API_URL || `${window.location.protocol}//${window.location.host}/api`;
|
||||
|
||||
console.log('🔌 WebSocket URL:', WS_URL);
|
||||
console.log('📡 API URL:', API_URL);
|
||||
|
||||
export const useTurtleStore = create((set, get) => ({
|
||||
// State
|
||||
|
||||
Reference in New Issue
Block a user