Skip to content

Commit

Permalink
[#2]✨Feat: cors 설정 Config
Browse files Browse the repository at this point in the history
  • Loading branch information
sumin220 committed Nov 19, 2024
1 parent 06e347b commit 40776b3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/main/java/univ/yesummit/global/auth/config/WebMvcConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package univ.yesummit.global.auth.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import univ.yesummit.global.resolver.AuthArgumentResolver;

import java.util.List;

@Configuration
@EnableWebMvc
@RequiredArgsConstructor
public class WebMvcConfig implements WebMvcConfigurer {

private final AuthArgumentResolver authArgumentResolver;

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


}

0 comments on commit 40776b3

Please sign in to comment.