Closed cotchan closed 2 years ago
CorsConfigurationSource
import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; @Bean public CorsConfigurationSource configurationSource() { List<String> clientUrls = List.of("http://localhost:3001", "http://localhost:3002"); CorsConfiguration configuration = new CorsConfiguration(); configuration.setAllowedOrigins(clientUrls); configuration.addAllowedHeader("*"); configuration.addAllowedMethod("*"); configuration.setAllowCredentials(true); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", configuration); return source; }
106
작업 내용
3000번 포트 닫고, 3001번, 3002번 포트 개방(blue, green) 하도록
CorsConfigurationSource
빈 설정 수정