UNPKG

@agatee/cli

Version:

CLI for Agatee App

6 lines (5 loc) 875 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mainSocketStarterCodeContent = void 0; var mainSocketStarterCodeContent = function (params) { /*javascript*/ return "import {Server, Socket} from 'socket.io';\nimport { GatSocket, onConnection } from '@agatee/socket';\n\n@GatSocket\nexport class MainSocket implements onConnection {\n public readonly io: Server;\n\n constructor() {\n const SOCKET_PORT: number = Number(process.env.SOCKET_PORT);\n this.io = new Server(SOCKET_PORT, {\n cors: {\n /** PUT link of client in the array **/\n // origin: ['http://localhost:4200']\n }\n });\n }\n\n onConnection(socket: Socket) {\n console.log('new Socket', socket.id);\n }\n}"; }; exports.mainSocketStarterCodeContent = mainSocketStarterCodeContent;