WebConfig.java
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 WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*")
.allowedMethods("GET", "POST", "PUT","DELETE", "HEAD", "OPTIONS","PATCH")
.maxAge(1800);
}
}'🌝Coding > 🌟WEB' 카테고리의 다른 글
| [Docker] Docker 이미지 (0) | 2023.02.19 |
|---|---|
| [Docker] Docker란? (0) | 2023.02.19 |
| [Vue] axios (0) | 2022.12.16 |
| [Vue] (0) | 2022.12.12 |
| [HTML/CSS] <ul> 태그 (0) | 2022.03.28 |