Skip to content

Instantly share code, notes, and snippets.

@wwwmarcos
Created September 13, 2017 03:03
Show Gist options
  • Save wwwmarcos/daa46d74f15ee6fbe52450bdfad768f3 to your computer and use it in GitHub Desktop.
Save wwwmarcos/daa46d74f15ee6fbe52450bdfad768f3 to your computer and use it in GitHub Desktop.
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("PUT", "DELETE", "POST", "GET")
.allowCredentials(false)
.maxAge(3600);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment