spring boot fix cors problem

Solutions on MaxInterview for spring boot fix cors problem by the best coders in the world

showing results for - "spring boot fix cors problem"
Mathilda
31 Sep 2018
1@CrossOrigin
2
Tino
22 Mar 2017
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