January 2018
Intermediate to advanced
414 pages
10h 29m
English
In our router, we define how we need to act on the HTTP GET request, by creating a lambda that will output our response. That piece of code is usually referred to as a handler. Let's expand the lambda to understand it better:
package com.microservices.chapter4import org.springframework.context.annotation.Beanimport org.springframework.stereotype.Componentimport org.springframework.web.reactive.function.server.ServerRequestimport org.springframework.web.reactive.function.server.ServerResponse.okimport org.springframework.web.reactive.function.server.routerimport reactor.core.publisher.toMono@Componentclass CustomerRouter { @Bean fun customerRoutes() = router { "/functional".nest { "/customer".nest { GET("/") { it: ServerRequest ...
Read now
Unlock full access