Skip to content

Commit

Permalink
✏️ Chore: CORS 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
techncherry committed Dec 2, 2024
1 parent 8866ae8 commit ccdfd91
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/miniproject/web02/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package miniproject.web02.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 WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH")
.allowedHeaders("*")
.allowCredentials(true);
}
}

0 comments on commit ccdfd91

Please sign in to comment.