Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ossycodes/basic-node-proto-buffer
https://github.com/ossycodes/basic-node-proto-buffer
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ossycodes/basic-node-proto-buffer
- Owner: ossycodes
- Created: 2021-06-26T12:21:11.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-06-26T12:42:55.000Z (over 3 years ago)
- Last Synced: 2024-11-10T11:06:27.632Z (about 1 month ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A basic gRPC Proto Buffer
please ensure you have a copy of the [Protobuffer](https://github.com/ossycodes/basic-node-proto-buffer) [producer](https://github.com/ossycodes/basic-node-grpc-producer) and [consumer](https://github.com/ossycodes/basic-node-grpc-consumer) and ensure you cloned this into a folder named `shared-proto`
## usage
`node folderyouclonedproducerinto/producer-grpc.js` ##terminal 1`node folderyouclonedconsumerinto/consumer-grpc.js` #terminal 2
`curl http://localhost:3000/` #terminal 3
you should get a reponse like this
```json
{
"consumer_id": 2000,
"producer_data": { "pid": "xxxx"},
"recipe": {
"id": 42, "name": "xxxx",
"steps: "xxxxx",
"ingredients": [
{
"id": 1,
"name": "xxxx",
"quantity" "xxxx"
},
{
"id": 2,
"name": "xxxx",
"quantity" "xxxx"
},
]
}
}
```## Big shoutout to Thomas Hunter II for the Distributed Nodejs book