diff --git a/server/src/api/record.ts b/server/src/api/record.ts index 610f1825..b55f06bc 100644 --- a/server/src/api/record.ts +++ b/server/src/api/record.ts @@ -650,7 +650,7 @@ export async function handleRunRecording(id: string, userId: string) { throw new Error('browserId or runId or userId is undefined'); } - const socket = io(`${process.env.BACKEND_URL}/${browserId}`, { + const socket = io(`${process.env.BACKEND_URL ? process.env.BACKEND_URL : 'http://localhost:8080'}/${browserId}`, { transports: ['websocket'], rejectUnauthorized: false }); diff --git a/server/src/workflow-management/scheduler/index.ts b/server/src/workflow-management/scheduler/index.ts index cde08a29..a94c6d16 100644 --- a/server/src/workflow-management/scheduler/index.ts +++ b/server/src/workflow-management/scheduler/index.ts @@ -223,7 +223,7 @@ export async function handleRunRecording(id: string, userId: string) { throw new Error('browserId or runId or userId is undefined'); } - const socket = io(`${process.env.BACKEND_URL}/${browserId}`, { + const socket = io(`${process.env.BACKEND_URL ? process.env.BACKEND_URL : 'http://localhost:8080'}/${browserId}`, { transports: ['websocket'], rejectUnauthorized: false }); diff --git a/src/apiConfig.js b/src/apiConfig.js index 8661491e..9cf20e94 100644 --- a/src/apiConfig.js +++ b/src/apiConfig.js @@ -1 +1 @@ -export const apiUrl = import.meta.env.VITE_BACKEND_URL; \ No newline at end of file +export const apiUrl = import.meta.env.VITE_BACKEND_URL ? import.meta.env.VITE_BACKEND_URL : 'http://localhost:8080' \ No newline at end of file