37 lines
1.3 KiB
Java
37 lines
1.3 KiB
Java
package com.paynuri.config;
|
|
|
|
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.ResourceHandlerRegistry;
|
|
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
@Configuration
|
|
public class WebConfig implements WebMvcConfigurer {
|
|
|
|
/**
|
|
* 정적 리소스 핸들러 설정
|
|
*/
|
|
@Override
|
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
registry.addResourceHandler("/static/**")
|
|
.addResourceLocations("classpath:/static/")
|
|
.setCachePeriod(3600);
|
|
|
|
registry.addResourceHandler("/uploads/**")
|
|
.addResourceLocations("file:uploads/")
|
|
.setCachePeriod(3600);
|
|
}
|
|
/**
|
|
* Interceptor 설정
|
|
*/
|
|
@Override
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
// 필요한 경우 Interceptor 추가
|
|
// registry.addInterceptor(new LoggingInterceptor())
|
|
// .addPathPatterns("/**")
|
|
// .excludePathPatterns("/static/**", "/css/**", "/js/**", "/images/**");
|
|
}
|
|
}
|