Skip to content

Instantly share code, notes, and snippets.

@grant
Created May 4, 2021 15:34
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/4474e610a2d2da3f704cad397ec11336 to your computer and use it in GitHub Desktop.
Save grant/4474e610a2d2da3f704cad397ec11336 to your computer and use it in GitHub Desktop.
Listen to gRPC requests
function main() {
const server = new grpc.Server();
server.addService(calculatorProto.Calculator.service, {calculate});
server.bindAsync(`0.0.0.0:${PORT}`, grpc.ServerCredentials.createInsecure(), (error, port) => {
if (error) {
throw error;
}
server.start();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment