diff --git a/.envExample b/.envExample index 7d3078d..7ab03af 100644 --- a/.envExample +++ b/.envExample @@ -1,7 +1,4 @@ -PORT=4000 -DEBUG=true RD_PORT=6379 RD_ADD=127.0.0.1 WS_SECRET=114514 -WS_PORT=4001 TOKEN=54188 diff --git a/src/config/config.service.ts b/src/config/config.service.ts index 5a08cdf..5b7d3f5 100644 --- a/src/config/config.service.ts +++ b/src/config/config.service.ts @@ -32,13 +32,7 @@ export class AppConfigService implements OnModuleInit { private checkRequiredVariables(): void { this.logger.log('检查必要环境变量..'); - const requiredVariables = [ - 'PORT', - 'RD_PORT', - 'RD_ADD', - 'WS_SECRET', - 'WS_PORT', - ]; + const requiredVariables = ['RD_PORT', 'RD_ADD', 'WS_SECRET']; requiredVariables.forEach((key) => { const value = this.nestConfigService.get(key); diff --git a/src/core/ws/ws.gateway.ts b/src/core/ws/ws.gateway.ts index 975c691..cfcde60 100644 --- a/src/core/ws/ws.gateway.ts +++ b/src/core/ws/ws.gateway.ts @@ -16,7 +16,7 @@ import { import { AppConfigService } from '../../config/config.service'; import { WsMessageHandler } from './ws-message.handler'; -@WebSocketGateway(7001, { +@WebSocketGateway({ cors: { origin: '*' }, driver: 'ws', })