enable CORS with spring
CORS could be enabled with spring programmatically. One of the ways to enable it is to add mapping to CorsRegistry like so:
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*");
}
};
}