Skip to content

Commit

Permalink
fix url
Browse files Browse the repository at this point in the history
  • Loading branch information
pail23 committed Feb 13, 2024
1 parent c59ac0a commit 3d2e768
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/devices.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export default class DevicesAPIService {
let pathname = new URL(baseUrl).pathname;
if (pathname.endsWith('/')) pathname = pathname.slice(0, -1);
// const sio_path = pathname + '/ws';
// const wsUrl = baseUrl.replace("http", "ws");
const wsUrl = baseUrl.replace('http', 'ws') + '/ws';

const devMode = process.env.NODE_ENV === 'development';
const wsUrl = devMode ? 'ws://localhost:5000/ws' : '';
//const devMode = process.env.NODE_ENV === 'development';
//const wsUrl = devMode ? 'ws://localhost:5000/ws' : '';
console.log(`Connecting to Energy Assistant WS API path ${wsUrl}`);

this.socket = new WebsocketBuilder(wsUrl)
Expand Down

0 comments on commit 3d2e768

Please sign in to comment.