fix: restore WsAdapter for RdpModule gateway, manual handler coexists
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
734ab5633e
commit
55b944bfc5
@ -1,5 +1,6 @@
|
|||||||
import { NestFactory } from '@nestjs/core';
|
import { NestFactory } from '@nestjs/core';
|
||||||
import { ValidationPipe } from '@nestjs/common';
|
import { ValidationPipe } from '@nestjs/common';
|
||||||
|
import { WsAdapter } from '@nestjs/platform-ws';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
import { WebSocketServer } from 'ws';
|
import { WebSocketServer } from 'ws';
|
||||||
import { TerminalGateway } from './terminal/terminal.gateway';
|
import { TerminalGateway } from './terminal/terminal.gateway';
|
||||||
@ -9,6 +10,7 @@ async function bootstrap() {
|
|||||||
const app = await NestFactory.create(AppModule);
|
const app = await NestFactory.create(AppModule);
|
||||||
app.setGlobalPrefix('api');
|
app.setGlobalPrefix('api');
|
||||||
app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));
|
app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));
|
||||||
|
app.useWebSocketAdapter(new WsAdapter(app));
|
||||||
app.enableCors({
|
app.enableCors({
|
||||||
origin: process.env.NODE_ENV === 'production' ? false : 'http://localhost:3001',
|
origin: process.env.NODE_ENV === 'production' ? false : 'http://localhost:3001',
|
||||||
credentials: true,
|
credentials: true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user