Skip to content

Commit

Permalink
GH-30: Added Node.js instructions in README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
jirenius committed Nov 25, 2019
1 parent 9482306 commit a050857
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ client.get('example.mymodel').then(model => {
>
> All examples are complete with both service and client.
## Usage in Node.js

To connect with *WebSockets* in Node.js, we must use a library implementing the [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), such as [isomorphic-ws](https://www.npmjs.com/package/isomorphic-ws).

```javascript
var WebSocket = require('isomorphic-ws');
var ResClient = require('resclient').default;
// Create instance with a WebSocket factory function
var client = new ResClient(() => new WebSocket("ws://localhost:8080"));
```

## Documentation

[Markdown documentation](docs/docs.md)

0 comments on commit a050857

Please sign in to comment.