Skip to content

Instantly share code, notes, and snippets.

@AdrianoJS
Last active April 19, 2023 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdrianoJS/1afadab8da22793f5d796ff525cd8b8c to your computer and use it in GitHub Desktop.
Save AdrianoJS/1afadab8da22793f5d796ff525cd8b8c to your computer and use it in GitHub Desktop.
package no.embriq.api.gateway.filter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
@Configuration
public class RouteHandlers {
@Bean
public RouterFunction<ServerResponse> handleRequest() {
return RouterFunctions.route(GET("/addThenSubtract"), request -> {
// ResultObjectType is not an actual class. It is only here to show necessary parameters
ResultObjectType result = methodThatReturnsResult();
return ServerResponse.ok().body(Mono.just(result), ResultObjectType.class));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment