January 2018
Intermediate to advanced
414 pages
10h 29m
English
In our router, we can create multiple paths to handle multiple requests, for example, let's create a new path for querying the customer list:
package com.microservices.chapter4import org.springframework.context.annotation.Beanimport org.springframework.stereotype.Componentimport org.springframework.web.reactive.function.server.router@Componentclass CustomerRouter(private val customerHandler: CustomerHandler) { @Bean fun customerRoutes() = router { "/functional".nest { "/customer".nest { GET("/{id}", customerHandler::get) } "/customers".nest { GET("/", customerHandler::get) } } }}
Now, we have a new router to get the customer list, but this can be done as well to define multiple HTTP verbs to handle:
package com.microservices.chapter4 ...Read now
Unlock full access