From d95a16c4f49c2ccaec55a2fbcc87d72d0b1bb638 Mon Sep 17 00:00:00 2001 From: Jun Yang Date: Mon, 9 Feb 2015 13:43:56 -0800 Subject: [PATCH 1/2] Added echoing of requested stock symbol. This makes the example more realistic. --- src/node/examples/stock_server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/examples/stock_server.js b/src/node/examples/stock_server.js index 07cea2ce5fa..61ba2731557 100644 --- a/src/node/examples/stock_server.js +++ b/src/node/examples/stock_server.js @@ -38,7 +38,7 @@ var examples = grpc.load(__dirname + '/stock.proto').examples; var StockServer = grpc.buildServer([examples.Stock.service]); function getLastTradePrice(call, callback) { - callback(null, {price: 88}); + callback(null, {symbol: call.request.symbol, price: 88}); } function watchFutureTrades(call) { From 79a78c2289a89b525fcdfa5c145a22e41e46b0f3 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 9 Feb 2015 15:58:33 -0800 Subject: [PATCH 2/2] Fixed typo in stock_server.js0 --- src/node/examples/stock_server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/examples/stock_server.js b/src/node/examples/stock_server.js index 61ba2731557..b226a715732 100644 --- a/src/node/examples/stock_server.js +++ b/src/node/examples/stock_server.js @@ -85,4 +85,4 @@ if (require.main === module) { stockServer.listen(); } -exports.module = stockServer; +module.exports = stockServer;