Skip to content

Instantly share code, notes, and snippets.

@djhuistra
Created April 8, 2018 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djhuistra/4da14903f3357a20cadbc1b515abd9de to your computer and use it in GitHub Desktop.
Save djhuistra/4da14903f3357a20cadbc1b515abd9de to your computer and use it in GitHub Desktop.
Application Configuration for CORS
@SpringBootApplication
public class DPAService {
public static void main(String[] args) {
SpringApplication.run(DPAService.class, args);
}
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*").allowedMethods("*");
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment