Skip to content

Commit

Permalink
[FEAT] #26 - Add cors mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
gmlwo530 committed Sep 14, 2021
1 parent 57c13d3 commit 0a4a4a6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/opgg/weba/JamPick/config/JampickConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver;

import java.util.Locale;

@Configuration
public class JampickConfiguration {
public class JampickConfiguration implements WebMvcConfigurer {
@Bean
public ModelMapper modelMapper() {
ModelMapper modelMapper = new ModelMapper();
Expand All @@ -21,6 +23,7 @@ public ModelMapper modelMapper() {
return modelMapper;
}


@Bean
public LocaleResolver localeResolver() {

Expand All @@ -29,4 +32,11 @@ public LocaleResolver localeResolver() {

return localeResolver;
}

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*");

}
}

0 comments on commit 0a4a4a6

Please sign in to comment.