diff options
Diffstat (limited to 'examples/node/greeter_server.js')
-rw-r--r-- | examples/node/greeter_server.js | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/examples/node/greeter_server.js b/examples/node/greeter_server.js index 2fb95f0f90..44b44afaaf 100644 --- a/examples/node/greeter_server.js +++ b/examples/node/greeter_server.js @@ -36,8 +36,6 @@ var PROTO_PATH = __dirname + '/helloworld.proto'; 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 @@ function sayHello(call, callback) { * 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(); |