diff --git a/client/src/axios-common.ts b/client/src/axios-common.ts index 3eb58b5..87d4ae2 100644 --- a/client/src/axios-common.ts +++ b/client/src/axios-common.ts @@ -4,7 +4,7 @@ console.log(import.meta.env.DEV); console.log(import.meta.env.VITE_ORBITAL_SERVER_URL); export const axiosInstance = new Axios({ - baseURL: import.meta.env.DEV ? import.meta.env.VITE_ORBITAL_SERVER_URL ?? "" : window.location.href, + baseURL: import.meta.env.DEV ? import.meta.env.VITE_ORBITAL_SERVER_URL ?? "" : window.location.origin, transformRequest: (data) => JSON.stringify(data), headers: { "Content-Type": "application/json", diff --git a/client/src/ws.ts b/client/src/ws.ts index b5d73a1..f0bcb74 100644 --- a/client/src/ws.ts +++ b/client/src/ws.ts @@ -25,7 +25,7 @@ export const WebSocketHandler = { } console.log("Starting connection to WebSocket Server"); - const wsUrl = import.meta.env.DEV ? new URL(import.meta.env.SERVER_URL) : new URL(window.location.href); + const wsUrl = import.meta.env.DEV ? new URL(import.meta.env.SERVER_URL) : new URL(window.location.origin); // const wsProtocol = window.location.protocol === "https:" ? "wss://" : "ws://"; // export const ws = new WebSocket(wsProtocol + location.host + "/");