Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
added example
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Jan 29, 2014
1 parent af411e8 commit 01ed37e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ reg.lookup('my-service-name', function(err, service) {

```

Running the above example will produce the following output
Running the above [example](https://github.com/mafintosh/etcd-registry/blob/master/example.js) will produce the following output

```
Found the following service:
Expand Down
16 changes: 16 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var registry = require('./');

var client = registry('127.0.0.1:4001,127.0.0.1:4002,127.0.0.1:4003');

client.join('test', {
port:8080,
inserted:Date.now()
}, function() {
setTimeout(function() {
client.lookup('test', function(err, service) {
console.log('error:', err);
console.log('service:', service);
client.leave();
});
}, 100);
});

0 comments on commit 01ed37e

Please sign in to comment.