An example of simple microservice with nestjs using gRPC.
-
open your prefered terminal application and clone this repository
-
Move into this example directory
cd nestjs-grpc-microservice-example
-
change directory to
hero-service
cd hero-service
-
run
npm install
and thennpm run start:dev
-
open another terminal window and change into
gateway
directory -
run
npm install
and thennpm run start:dev
-
Open your browser go to
http://localhost:3000/hero
to see list of heroes orhttp://localhost:3000/hero/1
to see hero with id of1
, you may change the number1
into other number, there is currently 3 hero in the list.
gateway -> Api gateway to serve data as json
hero-service -> hero service to provide hero data
protos -> directory contains proto file to describe the structure of data.