Updated Node examples to be compatible with master
diff --git a/examples/node/greeter_server.js b/examples/node/greeter_server.js
index 2fb95f0..44b44af 100644
--- a/examples/node/greeter_server.js
+++ b/examples/node/greeter_server.js
@@ -36,8 +36,6 @@
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;
-var Server = grpc.buildServer([hello_proto.Greeter.service]);
-
/**
* Implements the SayHello RPC method.
*/
@@ -50,14 +48,10 @@
* sample server port
*/
function main() {
- var server = new Server({
- "helloworld.Greeter": {
- sayHello: sayHello
- }
- });
-
- server.bind('0.0.0.0:50051');
- server.listen();
+ var server = new grpc.Server();
+ server.addProtoService(hello_proto.Greeter.service, {sayHello: sayHello});
+ server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
+ server.start();
}
main();