diff --git a/pom.xml b/pom.xml index f2afd53..e2f7a2d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.wiemanboy WiemanApi - 1.1.3 + 1.1.4 WiemanApi WiemanApi diff --git a/src/main/java/com/wiemanboy/wiemanapi/config/GlobalCorsConfig.java b/src/main/java/com/wiemanboy/wiemanapi/config/GlobalCorsConfig.java new file mode 100644 index 0000000..6d41622 --- /dev/null +++ b/src/main/java/com/wiemanboy/wiemanapi/config/GlobalCorsConfig.java @@ -0,0 +1,18 @@ +package com.wiemanboy.wiemanapi.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class GlobalCorsConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry corsRegistry) { + corsRegistry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") + .allowedHeaders("*") + .allowCredentials(false); + } +} \ No newline at end of file