Merge branch 'dev' into main
CI / build (push) Failing after 11m54s
Deploy / deploy (push) Failing after 15m13s

This commit is contained in:
ByungCheol
2026-05-31 19:12:56 +09:00
@@ -5,8 +5,11 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/** /**
* Vue 개발 서버(기본 5173)에서의 호출을 허용하기 위한 CORS 설정. * CORS 설정.
* 운영 환경에서는 allowedOrigins 를 실제 도메인으로 제한하세요. * - Vue 개발 서버(기본 5173)
* - Capacitor 안드로이드/iOS 앱 WebView 오리진 (capacitor://localhost, http(s)://localhost)
* 운영 웹은 Nginx 가 같은 도메인의 /api 로 프록시하므로 CORS 불필요.
* 별도 도메인에서 호출한다면 그 도메인을 allowedOrigins 에 추가하세요.
*/ */
@Configuration @Configuration
public class CorsConfig implements WebMvcConfigurer { public class CorsConfig implements WebMvcConfigurer {
@@ -14,7 +17,12 @@ public class CorsConfig implements WebMvcConfigurer {
@Override @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**") registry.addMapping("/api/**")
.allowedOrigins("http://localhost:5173") .allowedOrigins(
"http://localhost:5173", // Vue 개발 서버
"capacitor://localhost", // Capacitor (iOS scheme)
"https://localhost", // Capacitor Android (기본 https scheme)
"http://localhost" // Capacitor Android (http scheme)
)
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedHeaders("*") .allowedHeaders("*")
.allowCredentials(true) .allowCredentials(true)