Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- public class PersonRouter {
- @Bean
- public RouterFunction<ServerResponse> route(PersonHandler personHandler) {
- return RouterFunctions.route(GET("/people/{id}").and(accept(APPLICATION_JSON)), personHandler::get)
- .andRoute(GET("/people").and(accept(APPLICATION_JSON)), personHandler::all)
- .andRoute(POST("/people").and(accept(APPLICATION_JSON)).and(contentType(APPLICATION_JSON)), personHandler::post)
- .andRoute(PUT("/people/{id}").and(accept(APPLICATION_JSON)).and(contentType(APPLICATION_JSON)), personHandler::put)
- .andRoute(DELETE("/people/{id}"), personHandler::delete)
- .andRoute(GET("/people/country/{country}").and(accept(APPLICATION_JSON)), personHandler::getByCountry);
- }
- }
Add Comment
Please, Sign In to add comment