Skip to content

updated README, replace .create with .$create #15

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

Merged
merged 1 commit into from
Aug 20, 2014
Merged
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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Firing up an efficient JSON-RPC server becomes extremely simple:
```js
var rpc = require('json-rpc2');

var server = rpc.Server.create({
var server = rpc.Server.$create({
'websocket': true, // is true by default
'headers': { // allow custom headers is empty by default
'Access-Control-Allow-Origin': '*'
Expand Down Expand Up @@ -58,7 +58,7 @@ And creating a client to speak to that server is easy too:
```js
var rpc = require('json-rpc2');

var client = rpc.Client.create(8000, 'localhost');
var client = rpc.Client.$create(8000, 'localhost');

// Call add function on the server

Expand All @@ -72,7 +72,7 @@ Create a raw (socket) server using:
```js
var rpc = require('json-rpc2');

var server = rpc.Server.create();
var server = rpc.Server.$create();

// non-standard auth for RPC, when using this module using both client and server, works out-of-the-box
server.enableAuth('user', 'pass');
Expand All @@ -98,8 +98,8 @@ rpc.Endpoint.include({
});

var
server = rpc.Server.create(),
client = rpc.Client.create();
server = rpc.Server.$create(),
client = rpc.Client.$create();

server.newFunction(); // already available
client.newFunction(); // already available
Expand Down Expand Up @@ -144,7 +144,7 @@ var MyCoolServer = require('json-rpc2').Server.define('MyCoolServer', {
}); // MyCoolServer will contain all class and instance functions from Server

MyCoolServer.myOwnClassMethod(); // class function
MyCoolServer.create().myOwnFunction(); // instance function
MyCoolServer.$create().myOwnFunction(); // instance function
```

## Debugging
Expand Down