Skip to content

Commit

Permalink
Hotfix dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryBrain committed Aug 18, 2024
1 parent 713c4eb commit 10f1194
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_ORBITAL_SERVER_URL=http://localhost:3000
5 changes: 4 additions & 1 deletion client/src/axios-common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Axios } from "axios";

console.log(import.meta.env.DEV);
console.log(import.meta.env.VITE_ORBITAL_SERVER_URL);

export const axiosInstance = new Axios({
baseURL: window.location.href ?? "",
baseURL: import.meta.env.DEV ? import.meta.env.VITE_ORBITAL_SERVER_URL ?? "" : window.location.href,
transformRequest: (data) => JSON.stringify(data),
headers: {
"Content-Type": "application/json",
Expand Down
2 changes: 1 addition & 1 deletion client/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const WebSocketHandler = {
}

console.log("Starting connection to WebSocket Server");
const wsUrl = new URL(window.location.href);
const wsUrl = import.meta.env.DEV ? new URL(import.meta.env.SERVER_URL) : new URL(window.location.href);

// const wsProtocol = window.location.protocol === "https:" ? "wss://" : "ws://";
// export const ws = new WebSocket(wsProtocol + location.host + "/");
Expand Down

0 comments on commit 10f1194

Please sign in to comment.