Show HN: I wrote a book about Vavr and Java – Practical Vavr
leanpub.com1 pointsby flaie1 comments
public UserDTO register(UserRegistrationRequest registrationRequest) {
return Try.of(() -> authService.userExists(registrationRequest.email))
.filter(Objects::isNull, () -> badRequest("user already exists"))
.map(userId -> authService.register(registrationRequest.email, registrationRequest.password))
.get();
}
The login() function would be using the same pattern to call authService.verify() then filtering nonNull and signing the JWT, so it would be the same pattern for both.
Opus and GPT are very good at it, it's fast to build and start, convenient to deploy and host, one binary. I like it very much.
Very good stack to iterate fast.