Skip to content

Commit

Permalink
Merge pull request #62 from DONGA-ST-A/setting/61-cors-setting
Browse files Browse the repository at this point in the history
[Setting] CORS 설정
  • Loading branch information
kyeong-hyeok authored Sep 13, 2023
2 parents 67aa359 + e18b6f7 commit 23dcf39
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/teamA/hicardi/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.teamA.hicardi.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", "OPTIONS")
.allowCredentials(true)
.allowedHeaders("*")
.maxAge(3000);
}
}

0 comments on commit 23dcf39

Please sign in to comment.