Created
May 4, 2021 15:34
-
-
Save grant/4474e610a2d2da3f704cad397ec11336 to your computer and use it in GitHub Desktop.
Listen to gRPC requests
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 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