Skip to content

Instantly share code, notes, and snippets.

@cfsghost
Last active September 26, 2017 22:51
Show Gist options
  • Save cfsghost/3ab5c4cad977da9f47acd10ce8873d5d to your computer and use it in GitHub Desktop.
Save cfsghost/3ab5c4cad977da9f47acd10ce8873d5d to your computer and use it in GitHub Desktop.
Groa.js : Koa-like gRPC Middleware Framework - example1-client.js
const { Client } = require('groa');
const main = async () => {
let client = new Client('0.0.0.0', 50051);
// Load definition file
await client.loadProto(__dirname + '/example1.proto');
// Get specific service
let Example1 = client.getService('example.foo.Example1');
// call method
let ret = await Example1.ping({
content: 'hello!!!!'
});
console.log(ret);
};
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment