Last active
September 26, 2017 22:51
-
-
Save cfsghost/3ab5c4cad977da9f47acd10ce8873d5d to your computer and use it in GitHub Desktop.
Groa.js : Koa-like gRPC Middleware Framework - example1-client.js
This file contains 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
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