Skip to content

Commit

Permalink
refactor: Replace Config.ts with Variables.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomtec331 committed Jul 9, 2024
1 parent c5e3397 commit aeb5c32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 33 deletions.
28 changes: 0 additions & 28 deletions frontend/src/api/Config.ts

This file was deleted.

8 changes: 5 additions & 3 deletions frontend/src/api/GuacamoleTunnel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import config from "./Config";
import Guacamole from "guacamole-common-js";

import { variables } from "../utilities/Variables";
import { GuacamoleProxyTunnel } from "./GuacamoleProxyTunnel";

export default function createTunnel(
Expand All @@ -10,6 +10,8 @@ export default function createTunnel(
pathAndQuery = "/" + pathAndQuery;
}

console.log(`${config.wsBackendHost}${pathAndQuery}`);
return new GuacamoleProxyTunnel(`${config.wsBackendHost}/ws${pathAndQuery}`);
console.log(`${variables.location.websocket.url}${pathAndQuery}`);
return new GuacamoleProxyTunnel(
`${variables.location.websocket.url}/ws${pathAndQuery}`,
);
}
4 changes: 2 additions & 2 deletions frontend/src/api/WebSocket.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import config from "./Config";
import { variables } from "../utilities/Variables";

export default function createWebSocket(pathAndQuery = "/"): WebSocket {
if (!pathAndQuery.startsWith("/")) {
pathAndQuery = "/" + pathAndQuery;
}

return new WebSocket(`${config.wsBackendHost}/ws${pathAndQuery}`);
return new WebSocket(`${variables.location.websocket.url}/ws${pathAndQuery}`);
}

0 comments on commit aeb5c32

Please sign in to comment.