MCPcopy Index your code
hub / github.com/postgres-ai/database-lab-engine / initWS

Function initWS

ui/packages/ce/src/api/engine/initWS.ts:4–10  ·  view source on GitHub ↗
(path: string, token: string)

Source from the content-addressed store, hash-verified

2import { WS_URL_PREFIX } from 'config/env'
3
4export const initWS: InitWS = (path: string, token: string): WebSocket => {
5 const url = new URL(WS_URL_PREFIX + path, window.location.href);
6 url.protocol = url.protocol.replace('http', 'ws');
7 const wsAddr = url.href + '?token=' + token;
8
9 return new WebSocket(wsAddr)
10}

Callers 1

initWS.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected