Last active
April 19, 2023 06:16
-
-
Save AdrianoJS/1afadab8da22793f5d796ff525cd8b8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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