From 243a45756a5867c35c9c31987208105a13a7694a Mon Sep 17 00:00:00 2001 From: DmitriyA Date: Wed, 9 Apr 2025 10:02:55 -0400 Subject: [PATCH] added the api prefix --- src/main.ts | 3 +++ src/metrics.gateway.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 88fd9d2..85934af 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,6 +5,9 @@ import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); + // Установка глобального префикса для всех маршрутов + app.setGlobalPrefix('api'); + //настройка CORS app.enableCors({ diff --git a/src/metrics.gateway.ts b/src/metrics.gateway.ts index 6fc765b..510e016 100644 --- a/src/metrics.gateway.ts +++ b/src/metrics.gateway.ts @@ -9,7 +9,7 @@ import { Logger } from '@nestjs/common'; methods: ['GET', 'POST'], credentials: true }, - namespace: '/metrics-ws' + namespace: '/api/metrics-ws' }) export class MetricsGateway implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect { @WebSocketServer() server: Server;