Skip to content
Snippets Groups Projects
Select Git revision
  • 21c7f68bb070459fc8425be604f35b5fd9075a7b
  • master default protected
  • arm-aarch-platform
  • arm-platform
  • vjpai-patch-3
  • vjpai-patch-1
  • v1.27.x
  • jtattermusch-patch-2
  • jtattermusch-patch-1
  • update-java-worker-example-in-performance-docs
  • revert-21805-revert-21797-reintroduce_21527
  • revert-21804-tls-credentials-1
  • zhen_cleanup_namecheck
  • revert-21806-revert-21767-revert-21725-revert-21680-cq_ordering
  • vjpai-patch-2
  • revert-21766-tls-credentials-1
  • revert-21640-change_local_tcp_security_level
  • revert-21680-cq_ordering
  • revert-21527-unify_boringssl_deps2
  • revert-20803-grpclb_stabilization
  • fix-kokoro-rvm-key
  • v1.27.0
  • v1.27.0-pre2
  • v1.27.0-pre1
  • v1.26.0
  • v1.26.0-pre1
  • v1.25.0
  • v1.25.0-pre1
  • v1.24.3
  • v1.24.2
  • v1.24.1
  • v1.23.1
  • v1.24.0
  • v1.24.0-pre2
  • v1.24.0-pre1
  • v1.22.1
  • v1.23.0
  • v1.23.0-pre1
  • v1.22.0
  • v1.22.0-pre1
  • v1.21.4
41 results

node

user avatar
LisaFC authored
5e01a418
History

gRPC in 3 minutes (Node.js)

PREREQUISITES

This requires Node 10.x or greater.

INSTALL

  • Clone this repository

    $ git clone https://github.com/grpc/grpc-common.git
  • Download the grpc debian packages from the latest grpc release and install them.

    • Later, it will possible to install them directly using apt-get install
    $ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc_0.5.0_amd64.deb
    $ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc-dev_0.5.0_amd64.deb
    $ sudo dpkg -i libgrpc_0.5.0_amd64.deb libgrpc-dev_0.5.0_amd64.deb
  • Install this package's dependencies

    $ cd grpc-common/node
    $ npm install

TRY IT!

  • Run the server

    $ # from this directory (grpc_common/node).
    $ node ./greeter_server.js &
  • Run the client

    $ # from this directory
    $ node ./greeter_client.js

NOTE

This directory has a copy of helloworld.proto because it currently depends on some Protocol Buffer 2.0 syntax that is deprecated in Protocol Buffer 3.0.

TUTORIAL

You can find a more detailed tutorial in gRPC Basics: Node.js.