Skip to content

Commit df7e1cf

Browse files
authored
Merge pull request #27 from CommitField/dev
chore : web config file add
2 parents e5092ac + d9e0633 commit df7e1cf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cmf.commitField.global.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
5+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6+
7+
@Configuration
8+
public class CustomWebMvcConfig implements WebMvcConfigurer {
9+
@Override
10+
public void addCorsMappings(CorsRegistry registry) {
11+
registry.addMapping("/**")
12+
.allowedOrigins(
13+
AppConfig.getSiteFrontUrl()
14+
)
15+
.allowedMethods("*")
16+
.allowedHeaders("*")
17+
.allowCredentials(true)
18+
.maxAge(3600);
19+
}
20+
}

0 commit comments

Comments
 (0)