A small example of a project to test gPRC technology.
A running Go
server that accepts requests from the Internet and communicates with Node
using gRPC
.
- Launch docker containers.
$ docker-compose up -d
- Execute any request from [API] (# api), for example:
http://localhost:8081/image?url=https://news.ycombinator.com/
Generating go/node code from proto files:
# Go -> go/services/proto
$ sh ./go/utils/grpc.sh
# Node -> node/src/grpc/proto
$ sh ./node/utils/grpc.sh
- Get site image:
/image?url=<website-url>
.
http://localhost:8081/image?url=https://news.ycombinator.com/
- Get site HTML:
/html?url=<website-url>
.
http://localhost:8081/html?url=https://news.ycombinator.com/
- Run
docker-compose
containers - Run
go test .
in go folder
Node
- @grpc/grpc-js - Pure JavaScript gRPC Client
- microsoft/playwright - Playwright to automate Chromium, Firefox and WebKit with a single API
- agreatfool/grpc_tools_node_protoc_ts - Generate TypeScript d.ts definitions for generated js files
- remy/nodemon - Live reload
- microsoft/TypeScript - TypeScript extends JavaScript by adding types
Go
- gRPC-Go - The Go implementation of gRPC
- cosmtrek/air - Live reload
- valyala/fasthttp - Fast HTTP implementation