diff --git a/src/main/java/tenten/blooming/global/config/WebMvcConfig.java b/src/main/java/tenten/blooming/global/config/WebMvcConfig.java new file mode 100644 index 0000000..a8c75cf --- /dev/null +++ b/src/main/java/tenten/blooming/global/config/WebMvcConfig.java @@ -0,0 +1,17 @@ +package tenten.blooming.global.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +@EnableWebMvc +public class WebMvcConfig implements WebMvcConfigurer { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("http://localhost:3000") + .allowedMethods("OPTIONS","GET","POST","PUT","DELETE"); + } +}