|
|
@ -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()); |
|
|
|