Created
March 11, 2024 02:39
-
-
Save msbaek/8d5dee54dcd6657a90d2ba63dc6dd783 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
class CorsConfiguration { | |
@Bean | |
WebMvcConfigurer corsConfigurer() { | |
return new WebMvcConfigurer() { | |
@Override | |
public void addCorsMappings(final CorsRegistry registry) { | |
registry.addMapping("/**") | |
.allowedHeaders("*") | |
.allowedMethods("*") | |
.allowedOriginPatterns( | |
"http://localhost:3000", | |
"https://*.myservice.com", | |
"http://*.myservice.io"); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment