Add new frontend - fix 14

This commit is contained in:
Urtzi Alfaro
2025-07-22 21:11:23 +02:00
parent dd05f3a0f5
commit 09f33519d9
5 changed files with 6 additions and 544 deletions

View File

@@ -1,5 +0,0 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View File

@@ -320,5 +320,5 @@ class ApiClient {
// FIXED: Create default instance with correct base URL (removed /api suffix)
export const apiClient = new ApiClient({
baseURL: process.env.REACT_APP_API_URL || 'http://localhost:8000/api/v1'
baseURL: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000/api/v1'
});

View File

@@ -216,13 +216,13 @@ class WebSocketManager extends EventEmitter {
private getWebSocketBaseUrl(): string {
if (typeof window !== 'undefined') { // Check if window is defined
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = process.env.REACT_APP_WS_URL || window.location.host;
const host = process.env.NEXT_PUBLIC_WS_URL || window.location.host;
return `${protocol}//${host}/ws`;
} else {
// Provide a fallback for server-side or non-browser environments
// You might want to get this from environment variables or a config file
// depending on your setup.
return process.env.REACT_APP_WS_URL || 'ws://localhost:3000/ws';
return process.env.NEXT_PUBLIC_WS_URL || 'ws://localhost:3000/ws';
}
}