Commit 2 Конфигурация

This commit is contained in:
Arklightning 2023-02-13 16:08:44 +04:00
parent cd752fcde9
commit 91591ae894
2 changed files with 15 additions and 0 deletions

View File

@ -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);
} }
} }

View 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("*");
}
}