Variabilize ws url

This commit is contained in:
ank 2024-06-22 18:12:28 +00:00
parent 980bd390c6
commit 9adafc1212
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,8 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build_wasm": "wasm-pack build --out-dir ../../dist/pkg ./crates/sp_client --target bundler --dev", "build_wasm": "wasm-pack build --out-dir ../../dist/pkg ./crates/sp_client --target bundler --dev",
"start": "webpack serve", "start": "webpack serve",
"build": "webpack" "build": "webpack",
"deploy": "sudo cp -r dist/* /var/www/html/"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

View File

@ -1,7 +1,7 @@
import Services from './services'; import Services from './services';
import { WebSocketClient } from './websockets'; import { WebSocketClient } from './websockets';
const wsurl = "ws://localhost:8090"; const wsurl = `wss://${window.location.hostname}/ws/`;
document.addEventListener('DOMContentLoaded', async () => { document.addEventListener('DOMContentLoaded', async () => {
try { try {
const services = await Services.getInstance(); const services = await Services.getInstance();