From b1e8a89785730a913d4291c3d36ac679d5eb128a Mon Sep 17 00:00:00 2001 From: ChoiWheatley Date: Sat, 4 Jan 2025 23:49:21 +0900 Subject: [PATCH] feat(gateway): SOCKET_PORT on decorator --- src/session/catch.gateway.ts | 5 ++++- src/session/redgreen.gateway.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/session/catch.gateway.ts b/src/session/catch.gateway.ts index cd4ebe4..9a0e931 100644 --- a/src/session/catch.gateway.ts +++ b/src/session/catch.gateway.ts @@ -17,8 +17,11 @@ import { Host } from 'src/session-info/entities/host.entity'; import { CatchGame } from 'src/session-info/entities/catch.game.entity'; import { SocketExtension } from './socket.extension'; import * as AsyncLock from 'async-lock'; +import * as dotenv from 'dotenv'; -@WebSocketGateway({ +dotenv.config(); + +@WebSocketGateway(+process.env.SOCKET_PORT, { namespace: 'catch', /// TODO - namespace는 나중에 정의할 것 transports: ['websocket'], pingInterval: 3000, diff --git a/src/session/redgreen.gateway.ts b/src/session/redgreen.gateway.ts index c5963bf..f891017 100644 --- a/src/session/redgreen.gateway.ts +++ b/src/session/redgreen.gateway.ts @@ -14,8 +14,11 @@ import { RedGreenPlayer } from 'src/session-info/entities/redgreen.player.entity import { Host } from 'src/session-info/entities/host.entity'; import { RedGreenGame } from 'src/session-info/entities/redgreen.game.entity'; import * as AsyncLock from 'async-lock'; +import * as dotenv from 'dotenv'; -@WebSocketGateway({ +dotenv.config(); + +@WebSocketGateway(+process.env.SOCKET_PORT, { namespace: 'redgreen', transports: ['websocket'], pingInterval: 3000,