Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync lamp info #95

Merged
merged 9 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Hotfix dev mode
  • Loading branch information
BinaryBrain committed Aug 18, 2024
commit 10f1194abd7c0a0e15f03c93a85938a01a5c1dab
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