Skip to content

Commit

Permalink
chore : global filter
Browse files Browse the repository at this point in the history
  • Loading branch information
kangjuhyup committed Oct 12, 2024
1 parent 67bc5d1 commit b74056f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import 'dotenv/config';
import { ValidationPipe } from '@nestjs/common';
import { HttpExceptionFilter } from './common/exception/filter';
import { BaseExceptionFilter } from './common/exception/filter';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.setGlobalPrefix('api');
Expand All @@ -12,6 +12,7 @@ async function bootstrap() {
whitelist: true,
}),
);
app.useGlobalFilters(new BaseExceptionFilter());
if (process.env.NODE_ENV === 'local') {
app.enableCors({
origin: 'http://localhost:5173', // React 앱 도메인
Expand Down

0 comments on commit b74056f

Please sign in to comment.