Skip to content

Commit

Permalink
fix: swagger-ui and h2-console work again
Browse files Browse the repository at this point in the history
fixes #99
  • Loading branch information
gotson committed Feb 29, 2020
1 parent ccb7fbe commit 626f047
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ import java.util.concurrent.TimeUnit
@Configuration
class StaticResourceConfiguration : WebMvcConfigurer {
override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
registry//.setOrder(Ordered.HIGHEST_PRECEDENCE)
if (!registry.hasMappingForPattern("/webjars/**")) {
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/")
}

if (!registry.hasMappingForPattern("/swagger-ui.html**")) {
registry
.addResourceHandler("/swagger-ui.html**")
.addResourceLocations("classpath:/META-INF/resources/swagger-ui.html")
}

registry
.addResourceHandler(
"/index.html",
"/favicon.ico"
Expand Down

0 comments on commit 626f047

Please sign in to comment.