반응형
src/main.ts에서 아래 코드 내용을 추가한다.
import { NestFactory } from '@nestjs/core';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
...
app.enableCors({
origin: [
"http://[client 주소 (frontend 주소)]",
],
credentials: true,
});
...
}
bootstrap();
반응형
'개발 프레임워크 > NestJS' 카테고리의 다른 글
[NestJS] vscode Delete eslint (prettier/prettier)오류 (0) | 2023.08.24 |
---|---|
[MongoDB, NestJS] DB 트랜잭션을 이용한 자원소비 코드 (0) | 2023.03.26 |
[NestJS] @ValidationNested로 하위 연관 dto 검증하기 (0) | 2023.03.04 |
[Mongoose] Model.events, Model관련 Error 처리 (0) | 2023.03.01 |
[NestJS] 배열 구문 분석 및 유효성 검사, DTO 검증 (0) | 2023.02.23 |
댓글