Commit 2 Конфигурация
This commit is contained in:
parent
cd752fcde9
commit
91591ae894
@ -16,4 +16,6 @@ public class DemoApplication {
|
|||||||
public String hello(@RequestParam(value = "name", defaultValue = "World") String name) {
|
public String hello(@RequestParam(value = "name", defaultValue = "World") String name) {
|
||||||
return String.format("Hello %s!", name);
|
return String.format("Hello %s!", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
13
src/main/java/com/example/demo/WebConfiguration.java
Normal file
13
src/main/java/com/example/demo/WebConfiguration.java
Normal file
@ -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("*");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user