Java Code Examples for org.springframework.web.reactive.config.WebFluxConfigurer

The following examples show how to use org.springframework.web.reactive.config.WebFluxConfigurer. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: openapi-generator   Source File: OpenAPI2SpringBoot.java    License: Apache License 2.0 6 votes vote down vote up
@Bean
public WebFluxConfigurer webConfigurer() {
    return new WebFluxConfigurer() {
        /*@Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/**")
                    .allowedOrigins("*")
                    .allowedMethods("*")
                    .allowedHeaders("Content-Type");
        }*/

        @Override
        public void addResourceHandlers(ResourceHandlerRegistry registry) {
            registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
        }
    };
}
 
Example 2
Source Project: spring-fu   Source File: ReactiveWebServerInitializer.java    License: Apache License 2.0 4 votes vote down vote up
public EnableWebFluxConfigurationWrapper(GenericApplicationContext context, WebFluxProperties webFluxProperties) {
	super(webFluxProperties, context.getBeanProvider(WebFluxRegistrations.class));
	setConfigurers(new ArrayList<>(context.getBeansOfType(WebFluxConfigurer.class).values()));
}
 
Example 3
@Override
public void configureArgumentResolvers(ArgumentResolverConfigurer configurer) {
	WebFluxConfigurer.super.configureArgumentResolvers(configurer);
	configurer
			.addCustomResolver(context.getBean(ProxyExchangeArgumentResolver.class));
}