From 339df2b26a5d2c9bea88c31a7445aff4f502da9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=90=E4=BA=91=E6=B9=98=E5=A4=95?= Date: Mon, 23 Jan 2023 23:22:29 +0800 Subject: [PATCH] perf(core): set global prefix exclude for console --- apps/core/src/bootstrap.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/core/src/bootstrap.ts b/apps/core/src/bootstrap.ts index 4389d57e7..a0ca81ebc 100644 --- a/apps/core/src/bootstrap.ts +++ b/apps/core/src/bootstrap.ts @@ -7,7 +7,7 @@ * Coding With IU */ -import { Logger, ValidationPipe } from '@nestjs/common'; +import { Logger, RequestMethod, ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { NestFastifyApplication } from '@nestjs/platform-fastify'; import { AppModule } from './app.module'; @@ -57,7 +57,10 @@ export async function bootstrap() { }), ); - !isDev && app.setGlobalPrefix(`api`); + !isDev && + app.setGlobalPrefix(`api`, { + exclude: [{ path: '/console/*', method: RequestMethod.ALL }], + }); if (isDev) { app.useGlobalInterceptors(new LoggingInterceptor());