Skip to content

Instantly share code, notes, and snippets.

@grant
Created May 4, 2021 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/13bf9a346f89402f178ebad4436654f4 to your computer and use it in GitHub Desktop.
Save grant/13bf9a346f89402f178ebad4436654f4 to your computer and use it in GitHub Desktop.
gRPC Server
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