CORS 문제가 지속 발생할시,,, Config 폴더에 WebMvcConfig.java 생성
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 WebMvcConfig implements WebMvcConfigurer {
@Override public void addCorsMappings(CorsRegistry registry){ registry.addMapping("/**") .allowedOrigins("http://localhost:3000") .allowedMethods("OPTIONS", "GET", "POST", "PUT", "DELETE"); }
}
There was an error while loading. Please reload this page.