Skip to content

Commit

Permalink
#54 create example package for grpc client using grpc-transport
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm committed Dec 20, 2020
1 parent e8b60d0 commit 48cce76
Show file tree
Hide file tree
Showing 14 changed files with 591 additions and 10 deletions.
2 changes: 2 additions & 0 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,8 @@ for await (let hat of streamingCall.response) {
```
For more information, have a look at the example client in [packages/example-node-grpc-client](https://github.com/timostamm/protobuf-ts/tree/master/packages/example-node-grpc-client).
## Angular support
Expand Down
1 change: 1 addition & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
- [example-google-grpcweb-client](./example-google-grpcweb-client) - gRPC-web client in JavaScript, using google-protobuf and @grpc/grpc-js
- [example-go-twirp-server](example-go-twirp-server) - a Twirp server in go, works with the example Angular app
- [example-dotnet-grpc-client](./example-dotnet-grpc-client) - a gRPC client in dotnet
- [example-node-grpc-client](./example-node-grpc-client) - a gRPC client using @protobuf-ts/grpc-transport, running in Node.JS
- [test-fixtures](./test-fixtures) - example .proto files and test fixtures
- [benchmarks](./benchmarks) - code size and performance benchmarks
1 change: 1 addition & 0 deletions packages/example-node-grpc-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
10 changes: 10 additions & 0 deletions packages/example-node-grpc-client/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: default generate run-client


default: generate run-client

generate:
npx protoc -I . --ts_out . --ts_opt generate_dependencies,optimize_code_size service-example.proto

run-client:
npx ts-node client.ts
7 changes: 7 additions & 0 deletions packages/example-node-grpc-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@protobuf-ts/example-node-grpc-client
=====================================

This is a simple grpc client using @protobuf-ts/grpc-transport.

The client can be run against the example grpc server in the
directory "example-dotnet-grpc-server".
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ChannelCredentials} from "@grpc/grpc-js";
import {ExampleServiceClient, FailRequest, IExampleServiceClient} from "./service-example";
import {GrpcTransport} from "../src";
import {GrpcTransport} from "@protobuf-ts/grpc-transport";


const transport = new GrpcTransport({
Expand Down
335 changes: 335 additions & 0 deletions packages/example-node-grpc-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 48cce76

Please sign in to comment.