feat: add change endpoint to ws (#618)

* feat: add change endpoint to ws
This commit is contained in:
Carlos Valente
2023-11-26 19:02:16 +01:00
committed by GitHub
parent 9e285ee8f3
commit f2504072ce
4 changed files with 44 additions and 24 deletions
+2 -1
View File
@@ -17,6 +17,7 @@
import { LogOrigin } from 'ontime-types';
import { WebSocket, WebSocketServer } from 'ws';
import type { Server } from 'http';
import getRandomName from '../utils/getRandomName.js';
import { IAdapter } from './IAdapter.js';
@@ -43,7 +44,7 @@ export class SocketServer implements IAdapter {
this.wss = null;
}
init(server) {
init(server: Server) {
this.wss = new WebSocketServer({ path: '/ws', server });
this.wss.on('connection', (ws) => {