@@ -0,0 +1,1318 @@
+package com.example.webfluxexample;%0A%0Aimport static org.springframework.web.reactive.function.server.RequestPredicates.*;%0Aimport static org.springframework.web.reactive.function.server.RouterFunctions.*;%0A%0Aimport java.util.Objects;%0A%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.http.MediaType;%0Aimport org.springframework.web.reactive.function.server.RouterFunction;%0Aimport org.springframework.web.reactive.function.server.ServerRequest;%0Aimport org.springframework.web.reactive.function.server.ServerResponse;%0A%0Aimport reactor.core.publisher.Flux;%0Aimport reactor.core.publisher.Mono;%0A%0A@Configuration%0Apublic class FunctionalEndpoints %7B%0A%0A    @Bean%0A    public RouterFunction%3CServerResponse%3E routerFunction() %7B%0A        return route(POST(%22/add%22), this::handle);%0A    %7D%0A%0A    private Mono%3CServerResponse%3E handle(final ServerRequest request) %7B%0A        // curl localhost:8080/add -d a=2 -d b=3%0A%0A        final Mono%3CString%3E s = request.formData()%0A                .flatMapMany(a -%3E Flux.just(%22a%22, %22b%22).map(a::getFirst))%0A                .map(Integer::parseInt)%0A                .reduce(Integer::sum)%0A                .map(Objects::toString);%0A%0A        return ServerResponse.ok().contentType(MediaType.TEXT_PLAIN).body(s, String.class);%0A    %7D%0A%7D%0A

Add functional endpoints