journal.pl/src/socket.ts
2023-04-16 12:18:29 +03:00

18 lines
379 B
TypeScript

import { getConfigValue } from "@ijl/cli";
import { io } from "socket.io-client";
let socket = null;
export const getSocket = () => socket;
export const connect = () => {
socket = io(getConfigValue('journal.socket.url') + '/lessons', { path: getConfigValue('journal.socket.path')});
socket.on("connect", () => {
console.log('Socket connected', socket.id)
})
}