Update greeter_client.js

Switched declaration order
pull/8036/head
tania-m 9 years ago committed by GitHub
parent 93b09478f0
commit cb78540024
  1. 2
      examples/node/static_codegen/greeter_client.js

@ -39,13 +39,13 @@ var grpc = require('grpc');
function main() { function main() {
var client = new services.GreeterClient('localhost:50051', var client = new services.GreeterClient('localhost:50051',
grpc.credentials.createInsecure()); grpc.credentials.createInsecure());
var request = new messages.HelloRequest();
var user; var user;
if (process.argv.length >= 3) { if (process.argv.length >= 3) {
user = process.argv[2]; user = process.argv[2];
} else { } else {
user = 'world'; user = 'world';
} }
var request = new messages.HelloRequest();
request.setName(user); request.setName(user);
client.sayHello(request, function(err, response) { client.sayHello(request, function(err, response) {
console.log('Greeting:', response.getMessage()); console.log('Greeting:', response.getMessage());

Loading…
Cancel
Save