@ccci/micro-server 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99229,11 +99229,17 @@ var { Server, Namespace, Socket } = dist.default;
|
|
|
99229
99229
|
class WebSocketServer {
|
|
99230
99230
|
static io;
|
|
99231
99231
|
constructor(app, folderName = "sockets") {
|
|
99232
|
-
|
|
99233
|
-
|
|
99234
|
-
|
|
99235
|
-
|
|
99236
|
-
|
|
99232
|
+
try {
|
|
99233
|
+
Logger.info("Initializing websocket server");
|
|
99234
|
+
WebSocketServer.io = new Server(app);
|
|
99235
|
+
WebSocketServer.io.on("connection", (socket) => {
|
|
99236
|
+
Logger.info(`connected :>> ${JSON.stringify(socket)}`);
|
|
99237
|
+
socket.emit("connected", "Hello world");
|
|
99238
|
+
});
|
|
99239
|
+
} catch (error) {
|
|
99240
|
+
console.log("error :>> ", error);
|
|
99241
|
+
Logger.error(error);
|
|
99242
|
+
}
|
|
99237
99243
|
}
|
|
99238
99244
|
}
|
|
99239
99245
|
|