- JavaScript 100%
| recipe-api | ||
| shared | ||
| web-api | ||
| .gitignore | ||
| package.json | ||
| README.md | ||
| yarn.lock | ||
Distributed NodeJS Examples
Table of Contents
About
This is a working code repo created fot the book Distributed Systems with Node.js by Thomas Hunter.
There are two main components of this repo: The recipe API and the Web API. Each component has a couple of different options for starting the service depending on which protocol you want to use.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
Node.js, npm and Yarn are required to run this project.
npm i -g yarn
Installing
A step by step series of examples that tell you how to get a development env running.
Clone the repo:
git clone https://github.com/RileySeaburg/distributed-node.git
Install Package Dependencies
cd web-api yarn
And repeat
cd recipe-api yarn
End with an example of getting some data out of the system or using it for a little demo.
Usage
Currently HTTP and gRPC are implemented the files are labeled with the protocol name.
HTTP
Start the recipe API with the following command:
cd recipe-api
node producer-http-basic.js
Start the web API Consumer with the following command:
cd web-api
node consumer-http-basic.js
gRPC
Start the recipe API with the following command:
cd recipe-api
node producer-grpc.js
Start the web API Consumer with the following command:
cd web-api
node consumer-grpc.js