Skip to content

Commit 675bb15

Browse files
authored
연동용 Create WebConfig.java
1 parent c220d4b commit 675bb15

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.example.FixLog.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
5+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6+
7+
@Configuration
8+
public class WebConfig implements WebMvcConfigurer {
9+
10+
@Override
11+
public void addCorsMappings(CorsRegistry registry) {
12+
registry.addMapping("/**") // 모든 경로에 대해
13+
.allowedOrigins("*") // 모든 도메인 허용 (개발용) → 배포 시 정확한 프론트 주소로 수정 권장
14+
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
15+
.allowedHeaders("*")
16+
.allowCredentials(true); // 인증정보(쿠키, Authorization) 허용
17+
}
18+
}
19+

0 commit comments

Comments
 (0)