Skip to content

Commit

Permalink
feat: cors 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seoko97 committed Nov 27, 2024
1 parent 2f378c1 commit e76fd04
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ async function bootstrap() {
transform: true,
})
);

app.useGlobalInterceptors(new ResponseInterceptor());
app.useGlobalFilters(new HttpExceptionFilter(), new DBExceptionFilter());
app.setGlobalPrefix('api');

const configService = app.get(ConfigService);
const port = configService.get<number>('API_SERVER_PORT') ?? 3000;

const clientUrl = configService.get<string>('CLIENT_URL') ?? 'http://localhost:5173';
const port = configService.get<number>('API_SERVER_PORT') ?? 3065;

app.enableCors({
origin: [clientUrl],
credentials: true,
});

await app.listen(port);
}
Expand Down

0 comments on commit e76fd04

Please sign in to comment.