Skip to content

Commit

Permalink
v3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimserafim committed Jun 8, 2017
1 parent d2e2f4f commit a7e09a0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ a simple NodeJS client for gRPC
* **client(an optional {})**
- **type** string, with the values `unary` and `stream`, `unary` is the default value
- **address** string with the format `url:port`
- **creedentials** can use `credentials.createInsecure` or with certificates through an object { ca, key, client }
- **credentials** can use `credentials.createInsecure` or with certificates through an object { ca, key, client }
- **metadata** set metadata that can be used in all calls, an array with { key: value }

**methods**
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Client {
this._type = nConfig.type || 'unary'
this._address = nConfig.address || '0.0.0.0:50051'
this._metadata = addMetadata(nConfig.metadata)
this._creedentials = isObject(nConfig.creedentials)
? setAuthentication(nConfig.creedentials)
this._credentials = isObject(nConfig.credentials)
? setAuthentication(nConfig.credentials)
: credentials.createInsecure()
credentials.createInsecure()
}
Expand All @@ -34,7 +34,7 @@ class Client {
const Proto = load(protoFile)
const pkg = Object.keys(Proto)[0]

this._client = new Proto[pkg][service](this._address, this._creedentials)
this._client = new Proto[pkg][service](this._address, this._credentials)

const functions = filterRpcFunctions(this._client)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grpc.client",
"version": "3.0.0",
"version": "3.0.1",
"description": "a simple client for gRPC",
"main": "index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ describe('gRPC client', () => {
})

it('should emit an error when the certificates are missed', (done) => {
client({address: '127.0.0.1:50052', creedentials: null})
client({address: '127.0.0.1:50052', credentials: null})
.service('Greeter', protos.helloWorld)
.sayHello({ name: 'Scaramouche' })
.end((err, res) => {
Expand All @@ -256,7 +256,7 @@ describe('gRPC client', () => {
})

it('should do a rpc call successful', (done) => {
client({address: '127.0.0.1:50052', creedentials: clientCertificates})
client({address: '127.0.0.1:50052', credentials: clientCertificates})
.service('Greeter', protos.helloWorld)
.sayHello({ name: 'Scaramouche' })
.end((err, res) => {
Expand Down

0 comments on commit a7e09a0

Please sign in to comment.