-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathWebMvcConfig.java
More file actions
30 lines (24 loc) · 942 Bytes
/
WebMvcConfig.java
File metadata and controls
30 lines (24 loc) · 942 Bytes
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
package com.dku.springstudy.config;
import com.dku.springstudy.security.ResponseInterceptor;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@RequiredArgsConstructor
public class WebMvcConfig implements WebMvcConfigurer {
private final ResponseInterceptor responseInterceptor;
@Override
public void addCorsMappings(CorsRegistry registry) {
registry
.addMapping("/**")
.allowedOrigins("*");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry
.addInterceptor(responseInterceptor)
.addPathPatterns("/**");
}
}