package co.id.datacomsolusindo.ipphonebridge

import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.EnableWebMvc
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
import org.springframework.web.servlet.resource.PathResourceResolver

@Configuration
@EnableWebMvc
class MvcConfig : WebMvcConfigurer {
    override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
        registry
            .addResourceHandler("resources/**")
            .addResourceLocations("file:web/")
            .setCachePeriod(3600 * 24 * 30)
            .resourceChain(true)
            .addResolver(PathResourceResolver())
    }
}