fix: use dynamic URLs for API and Socket.IO
- Change API_URL from hardcoded 'http://localhost:8080/api' to '/api' - Change SOCKET_URL from hardcoded to window.location.origin - Fixes production build connecting to wrong port - Now works correctly in both dev (localhost:8080) and prod (localhost)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
const API_URL = 'http://localhost:8080/api';
|
||||
// Use relative URL - works for both dev (localhost:8080) and prod (localhost)
|
||||
// Nginx proxies /api to backend
|
||||
const API_URL = '/api';
|
||||
|
||||
class ApiError extends Error {
|
||||
constructor(message, status, data) {
|
||||
|
||||
Reference in New Issue
Block a user