Skip to content

Instantly share code, notes, and snippets.

@grant

grant/index.js

Created May 4, 2021
Embed
What would you like to do?
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