Created
May 4, 2021 17:17
-
-
Save grant/13bf9a346f89402f178ebad4436654f4 to your computer and use it in GitHub Desktop.
gRPC Server
This file contains hidden or 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
function calculate(call, callback) { | |
const request = call.request; | |
let result; | |
if (request.operation === 'ADD') { | |
result = request.first_operand + request.second_operand; | |
} else { | |
result = request.first_operand - request.second_operand; | |
} | |
callback(null, {result}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment