Skip to content

Instantly share code, notes, and snippets.

@timjonesdev
Created August 21, 2019 00:02
Show Gist options
  • Save timjonesdev/37e1c963dd4bace41d81dfb36f17fc4e to your computer and use it in GitHub Desktop.
Save timjonesdev/37e1c963dd4bace41d81dfb36f17fc4e to your computer and use it in GitHub Desktop.
The first team handler
/**
* Return all teams from the fantasy_db.teams collection
*
* @param request - the request (unused in this operation)
* @return a list of all teams
*/
public Mono<ServerResponse> getTeams(ServerRequest request) {
return ServerResponse.ok()
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromPublisher(this.teamRepository.findAll(), Team.class));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment