1@Configuration
2public class CorsConfig {
3
4 @Bean
5 public WebMvcConfigurer corsConfigurer() {
6 return new WebMvcConfigurerAdapter() {
7 @Override
8 public void addCorsMappings(CorsRegistry registry) {
9 registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE").allowedOrigins("*")
10 .allowedHeaders("*");
11 }
12 };
13 }
14}
15