Created
August 21, 2019 00:02
-
-
Save timjonesdev/37e1c963dd4bace41d81dfb36f17fc4e to your computer and use it in GitHub Desktop.
The first team handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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