Skip to content

Commit

Permalink
perf(core): set global prefix exclude for console (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
MYXXTS authored Jan 23, 2023
1 parent f93ab30 commit b901214
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/core/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit b901214

Please sign in to comment.