From 9adafc1212e37f4463d132d112edb4def0d4d169 Mon Sep 17 00:00:00 2001 From: ank Date: Sat, 22 Jun 2024 18:12:28 +0000 Subject: [PATCH] Variabilize ws url --- package.json | 3 ++- src/index.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ed3c7b3..2f6c391 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test": "echo \"Error: no test specified\" && exit 1", "build_wasm": "wasm-pack build --out-dir ../../dist/pkg ./crates/sp_client --target bundler --dev", "start": "webpack serve", - "build": "webpack" + "build": "webpack", + "deploy": "sudo cp -r dist/* /var/www/html/" }, "keywords": [], "author": "", diff --git a/src/index.ts b/src/index.ts index d379dd8..834bd9d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import Services from './services'; import { WebSocketClient } from './websockets'; -const wsurl = "ws://localhost:8090"; +const wsurl = `wss://${window.location.hostname}/ws/`; document.addEventListener('DOMContentLoaded', async () => { try { const services = await Services.getInstance();