20 lines
734 B
Kotlin
20 lines
734 B
Kotlin
package ch.dissem.bitmessage.server
|
|
|
|
import org.springframework.context.annotation.Configuration
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
|
|
|
|
|
@Configuration
|
|
class WebMvcConfig : WebMvcConfigurer {
|
|
|
|
override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
|
|
if (!registry.hasMappingForPattern("/webjars/**")) {
|
|
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/")
|
|
}
|
|
if (!registry.hasMappingForPattern("/**")) {
|
|
registry.addResourceHandler("/**").addResourceLocations("classpath:/public/")
|
|
}
|
|
}
|
|
|
|
} |