Skip to content

Instantly share code, notes, and snippets.

@nsbeyond
Last active October 5, 2022 07:10
Show Gist options
  • Save nsbeyond/67436d6145b8e0532df1ab4897421ab9 to your computer and use it in GitHub Desktop.
Save nsbeyond/67436d6145b8e0532df1ab4897421ab9 to your computer and use it in GitHub Desktop.
const AUTHENTICATION_PROTO_DIR = path.resolve("proto/authentication");
const authenticationProtoFiles = fs.readdirSync(AUTHENTICATION_PROTO_DIR);
const authenticationProtoPaths = _.map(authenticationProtoFiles, (f) =>
path.join(AUTHENTICATION_PROTO_DIR, f)
);
const grpc = new GRPCClient(
authenticationProtoPaths,
"authentication",
"Authentication",
"localhost:50051",
{
cert: path.resolve("tls/authentication/server.crt"),
}
);
grpc.runService(
'Hello',
dataToSend, (err, res) => {
console.log('Service response 2', res);
console.log('Service error 2', err);
}, options
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment