Skip to content

Commit

Permalink
[docs] Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Jul 18, 2012
1 parent f811205 commit 01b1964
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


# socketful # socketful


Creates [socket.io](http://socket.io) servers and event maps for [resourceful](http://github.com/flatiron/resourceful) resources. Can be used as a stand-alone module or as a [Flatiron](http://github.com/flatiron/) plugin. Reflects [socket.io](http://socket.io) servers and event maps from [resourceful](http://github.com/flatiron/resourceful) resources. Can be used as a stand-alone module or as a [Flatiron](http://github.com/flatiron/) plugin.


# Explanation # Explanation


Expand Down Expand Up @@ -48,21 +48,21 @@ server.on(resource, action, payload, callback);
**Example:** **Example:**


```js ```js
socket.emit('creature', 'create', { id: 'bob' } , function(err, bob) { socket.emit('creatures', 'create', { id: 'bob' } , function(err, bob) {
console.log('created: ', bob); console.log('created: ', bob);
}; };
``` ```
``` ```
Socket.io Event Action Socket.io Event Action


socket.emit('creature', 'create', data, callback) => Creature.create() socket.emit('creatures', 'create', data, callback) => Creature.create()
socket.emit('creature', 'get', data, callback) => Creature.get() socket.emit('creatures', 'get', data, callback) => Creature.get()
socket.emit('creature', 'all', data, callback) => Creature.all() socket.emit('creatures', 'all', data, callback) => Creature.all()
socket.emit('creature', 'update', data, callback) => Creature.update() socket.emit('creatures', 'update', data, callback) => Creature.update()
socket.emit('creature', 'destroy', data, callback) => Creature.destroy() socket.emit('creatures', 'destroy', data, callback) => Creature.destroy()
``` ```
The socket server will delegate all incoming `Creature` events to the resource and respond back with the appropriate result. The socket.io server will delegate all incoming `Creature` events to the resource and respond back with the appropriate result.
## Relational Resources ## Relational Resources
Expand Down
2 changes: 1 addition & 1 deletion examples/server.js
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
/* /*
* server.js: Simple http server with `socketful` server * server.js: Simple socket.io `socketful` server
* *
* (C) 2012, Nodejitsu Inc. * (C) 2012, Nodejitsu Inc.
* *
Expand Down

0 comments on commit 01b1964

Please sign in to comment.