Skip to content

Commit

Permalink
πŸš€ :: Api-v0.0.3-5
Browse files Browse the repository at this point in the history
πŸš€ :: Api-v0.0.3-5
  • Loading branch information
ImNM authored Jan 13, 2023
2 parents f533fc3 + dcf5c4c commit c8535f8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ public class CorsConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) {
String[] activeProfiles = env.getActiveProfiles();
ArrayList<String> allowedOriginPatterns = new ArrayList<>();
allowedOriginPatterns.add("dudoong.com");
allowedOriginPatterns.add("https://dudoong.com");
allowedOriginPatterns.add("https://staging.dudoong.com");
if (!Arrays.stream(activeProfiles).toList().contains("prod")) {
allowedOriginPatterns.add("localhost");
allowedOriginPatterns.add("http://localhost:3000");
}
String[] patterns = allowedOriginPatterns.toArray(String[]::new);
registry.addMapping("/**")
Expand Down

0 comments on commit c8535f8

Please sign in to comment.