Merge pull request #121 from getmaxun/manual-setup-error

fix: handle `undefined` backend url in local setup
This commit is contained in:
Karishma Shukla
2024-11-04 20:44:19 +05:30
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -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
});

View File

@@ -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
});

View File

@@ -1 +1 @@
export const apiUrl = import.meta.env.VITE_BACKEND_URL;
export const apiUrl = import.meta.env.VITE_BACKEND_URL ? import.meta.env.VITE_BACKEND_URL : 'http://localhost:8080'