-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathWebConfig.java
34 lines (34 loc) · 1.13 KB
/
WebConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//package EmployeeSystem.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.CorsRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//// TODO : check if can merge below
//// 1) enable CORS 2) show swagger 2.x UI properly
//@Configuration
//public class WebConfig implements WebMvcConfigurer {
// @Override
// public void addCorsMappings(CorsRegistry registry) {
// registry
// .addMapping("/**")
// .allowedOriginPatterns("*") // SpringBoot2.4.0 [allowedOriginPatterns]代替[allowedOrigins]
// .allowedMethods("*")
// .maxAge(3600)
// .allowCredentials(true);
// }
//
// @Bean
// public WebMvcConfigurer corsConfigurer() {
// return new WebMvcConfigurer() {
// @Override
// public void addCorsMappings(CorsRegistry registry) {
// registry
// .addMapping("/**")
// .allowedOrigins("*")
// .allowedMethods("GET", "PUT", "POST", "PATCH", "DELETE", "OPTIONS");
// }
// };
// }
//}