diff --git a/backend/src/main/java/codezap/global/cors/WebCorsConfiguration.java b/backend/src/main/java/codezap/global/cors/WebCorsConfiguration.java new file mode 100644 index 000000000..f2522c83a --- /dev/null +++ b/backend/src/main/java/codezap/global/cors/WebCorsConfiguration.java @@ -0,0 +1,19 @@ +package codezap.global.cors; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebCorsConfiguration implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowCredentials(true) + .allowedOriginPatterns("https://*.code-zap.com") + .allowedOrigins("https://code-zap.com") + .allowedMethods("*") + .exposedHeaders("*"); + } +}