|
@@ -4,7 +4,11 @@ import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.Profile;
|
|
import org.springframework.context.annotation.Profile;
|
|
import org.springframework.web.reactive.config.CorsRegistry;
|
|
import org.springframework.web.reactive.config.CorsRegistry;
|
|
import org.springframework.web.reactive.config.EnableWebFlux;
|
|
import org.springframework.web.reactive.config.EnableWebFlux;
|
|
|
|
+import org.springframework.web.reactive.config.ResourceHandlerRegistry;
|
|
import org.springframework.web.reactive.config.WebFluxConfigurer;
|
|
import org.springframework.web.reactive.config.WebFluxConfigurer;
|
|
|
|
+import org.springframework.web.reactive.resource.WebJarsResourceResolver;
|
|
|
|
+
|
|
|
|
+import static org.springdoc.core.Constants.CLASSPATH_RESOURCE_LOCATION;
|
|
|
|
|
|
@Configuration
|
|
@Configuration
|
|
@EnableWebFlux
|
|
@EnableWebFlux
|
|
@@ -19,4 +23,12 @@ public class CorsGlobalConfiguration implements WebFluxConfigurer {
|
|
.allowedHeaders("*")
|
|
.allowedHeaders("*")
|
|
.allowCredentials(true);
|
|
.allowCredentials(true);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
|
|
+ registry.addResourceHandler("/webjars/**")
|
|
|
|
+ .addResourceLocations(CLASSPATH_RESOURCE_LOCATION+"/webjars/")
|
|
|
|
+ .resourceChain(true)
|
|
|
|
+ .addResolver(new WebJarsResourceResolver());
|
|
|
|
+ }
|
|
}
|
|
}
|