vscode 설정 변경 및 환경 설정 변경
This commit is contained in:
@@ -16,7 +16,20 @@ async function bootstrap() {
|
||||
|
||||
// CORS 추가
|
||||
app.enableCors({
|
||||
origin: ['http://localhost:3000', 'http://192.168.11.249:3000'], // 프론트 서버 둘다 허용
|
||||
origin: (origin, callback) => {
|
||||
// origin이 없는 경우 (서버 간 요청, Postman 등) 허용
|
||||
if (!origin) return callback(null, true);
|
||||
|
||||
const allowedPatterns = [
|
||||
/^http:\/\/localhost:\d+$/, // localhost 모든 포트
|
||||
/^http:\/\/127\.0\.0\.1:\d+$/, // 127.0.0.1 모든 포트
|
||||
/^http:\/\/192\.168\.11\.\d+:\d+$/, // 192.168.11.* 대역
|
||||
/^https?:\/\/.*\.turbosoft\.kr$/, // *.turbosoft.kr
|
||||
];
|
||||
|
||||
const isAllowed = allowedPatterns.some(pattern => pattern.test(origin));
|
||||
callback(null, isAllowed);
|
||||
},
|
||||
credentials: true,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user