aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/node
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-02-05 13:05:31 -0800
committerGravatar murgatroid99 <mlumish@google.com>2016-02-05 13:05:31 -0800
commit95060b510e181588a7229ee498594a5864cf9926 (patch)
treebfe6f60cbd79a309f594c8b2fc92d1e955359f70 /examples/node
parentb59b142799fe28482162bc192d6205fcb749c6c4 (diff)
Make Node examples package self-contained
Diffstat (limited to 'examples/node')
-rw-r--r--examples/node/greeter_client.js4
-rw-r--r--examples/node/greeter_server.js4
-rw-r--r--examples/node/package.json7
-rw-r--r--examples/node/route_guide/route_guide_client.js6
-rw-r--r--examples/node/route_guide/route_guide_server.js6
5 files changed, 17 insertions, 10 deletions
diff --git a/examples/node/greeter_client.js b/examples/node/greeter_client.js
index e0b89bd376..9b4b0a7782 100644
--- a/examples/node/greeter_client.js
+++ b/examples/node/greeter_client.js
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@
var PROTO_PATH = __dirname + '/helloworld.proto';
-var grpc = require('../../');
+var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;
function main() {
diff --git a/examples/node/greeter_server.js b/examples/node/greeter_server.js
index 3600c8bfbf..2712b3dd3a 100644
--- a/examples/node/greeter_server.js
+++ b/examples/node/greeter_server.js
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@
var PROTO_PATH = __dirname + '/helloworld.proto';
-var grpc = require('../../');
+var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;
/**
diff --git a/examples/node/package.json b/examples/node/package.json
new file mode 100644
index 0000000000..65c5789ed7
--- /dev/null
+++ b/examples/node/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "grpc-examples",
+ "version": "0.1.0",
+ "dependencies": {
+ "grpc": "0.12.0"
+ }
+}
diff --git a/examples/node/route_guide/route_guide_client.js b/examples/node/route_guide/route_guide_client.js
index edeca6ff55..e38a21f422 100644
--- a/examples/node/route_guide/route_guide_client.js
+++ b/examples/node/route_guide/route_guide_client.js
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,13 +30,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
+
var async = require('async');
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
-var grpc = require('../../../');
+var grpc = require('grpc');
var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide;
var client = new routeguide.RouteGuide('localhost:50051',
grpc.Credentials.createInsecure());
diff --git a/examples/node/route_guide/route_guide_server.js b/examples/node/route_guide/route_guide_server.js
index 2090a6a1d2..06cf2925e1 100644
--- a/examples/node/route_guide/route_guide_server.js
+++ b/examples/node/route_guide/route_guide_server.js
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,12 +30,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
+
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
var _ = require('lodash');
-var grpc = require('../../../');
+var grpc = require('grpc');
var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide;
var COORD_FACTOR = 1e7;