Skip to content

Commit

Permalink
Merge pull request #24 from DS-UMC-7th/feature/#4
Browse files Browse the repository at this point in the history
✏️ Chore: CORS 설정
  • Loading branch information
techncherry authored Dec 2, 2024
2 parents 8866ae8 + ccdfd91 commit 72312f9
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 72312f9

Please sign in to comment.