Skip to content

Commit 6540ce9

Browse files
committed
Update Express CORS
1 parent 12ce8ff commit 6540ce9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ DB.init(); // DB 세팅
3535

3636
app.set("trust proxy", "loopback"); // 프록시 설정 배포 시 ON
3737
app.use(morgan("dev")); // 개발용 로그 미들웨어
38-
app.use(cors()); // CORS 설정 미들웨어
38+
app.use(cors({
39+
origin: process.env.ORIGIN ?? 'https://circles.hyunwoo.dev',
40+
credentials: true
41+
})); // CORS 설정 미들웨어
3942
app.use(helmet()); // 보안 미들웨어
4043
app.use(compression()); // 데이터 압축 미들웨어
4144
app.use(PassportJWTAuth.getInitialize()); // Passport 기본 세팅 미들웨어

0 commit comments

Comments
 (0)