Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): fix invalid method path and update grpc npm package #2046

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ function rpcImpl(method, requestData, callback) {
}
```

Below is a working example with a typescript implementation using grpc npm package.
Below is a working example with a typescript implementation using the `@grpc/grpc-js` npm package.
```ts
const grpc = require('grpc')
const grpc = require('@grpc/grpc-js')

const Client = grpc.makeGenericClientConstructor({})
const client = new Client(
Expand All @@ -421,8 +421,10 @@ const client = new Client(
)

const rpcImpl = function(method, requestData, callback) {
const methodPath = `/${method.parent.fullName.slice(1)}/${method.name}`;

client.makeUnaryRequest(
method.name,
methodPath,
arg => arg,
arg => arg,
requestData,
Expand Down