
entry-point.rest-webflux.router-functions.router.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.api;
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.ServerResponse;
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.RequestPredicates.POST;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
@Configuration
public class RouterRest {
@Bean
public RouterFunction routerFunction(Handler handler) {
return route(GET("/api/usecase/path"), handler::listenGETUseCase)
.andRoute(POST("/api/usecase/otherpath"), handler::listenPOSTUseCase)
.and(route(GET("/api/otherusercase/path"), handler::listenGETOtherUseCase));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy