@Configuration public class WebMvcConfig implements WebMvcConfigurer { @Profile("dev") @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedHeaders("*") .allowedMethods("*") .allowedOrigins("*") .allowCredentials(false); }