diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 89506cd..4396cee 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -16,4 +16,6 @@ public class DemoApplication { public String hello(@RequestParam(value = "name", defaultValue = "World") String name) { return String.format("Hello %s!", name); } + + } diff --git a/src/main/java/com/example/demo/WebConfiguration.java b/src/main/java/com/example/demo/WebConfiguration.java new file mode 100644 index 0000000..6d1cb02 --- /dev/null +++ b/src/main/java/com/example/demo/WebConfiguration.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +class webConfiguration implements WebMvcConfigurer { + @Override + public void addCorsMappings(CorsRegistry registry){ + registry.addMapping("/**").allowedMethods("*"); + } +}