Files
Stirling-PDF/src/main/java/stirling/software/SPDF/config/WebMvcConfig.java
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.0 KiB
Java
Raw Normal View History

2024-01-03 17:59:04 +00:00
package stirling.software.SPDF.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import lombok.RequiredArgsConstructor;
2024-01-03 17:59:04 +00:00
@Configuration
@RequiredArgsConstructor
2024-01-03 17:59:04 +00:00
public class WebMvcConfig implements WebMvcConfigurer {
private final EndpointInterceptor endpointInterceptor;
2024-01-03 17:59:04 +00:00
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(endpointInterceptor);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// Handler for external static resources
registry.addResourceHandler("/**")
2025-01-06 12:41:30 +00:00
.addResourceLocations(
"file:" + InstallationPathConfig.getStaticPath(), "classpath:/static/");
2024-01-03 17:59:04 +00:00
// .setCachePeriod(0); // Optional: disable caching
}
}