import { apiPort } from './api.js'; let singleton = false export class WS { constructor(){ if (singleton) { return singleton; } const endpoint = `ws://localhost:2015/ws/`; console.log(`endpoint is ${endpoint}`); this.conn = new WebSocket(endpoint); singleton = this; } }