Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

addCorsMappings registry.addMapping

//for Spring Boot
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/api/**")
            .allowedOrigins("http://domain2.com")
            .allowedMethods("PUT", "DELETE")
            .allowedHeaders("header1", "header2", "header3")
            .exposedHeaders("header1", "header2")
            .allowCredentials(false).maxAge(3600);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #addCorsMappings
ADD COMMENT
Topic
Name
2+9 =