Created
March 20, 2013 23:21
-
-
Save Kami/5209441 to your computer and use it in GitHub Desktop.
Service Registry - register a service (old way)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Client = require('service-registry-client').Client; | |
| var client = new Client('myuser', 'myapikey', null); | |
| var heartbeatTimeout = 15, serviceMetadata = {'tags': ['api']}; | |
| client.sessions.create(heartbeatTimeout, {}, function(err, seId, data, hb) { | |
| client.services.create(seId, 'serviceId', serviceMetadata, function(err, id) { | |
| // Session and service has been created, start heartbeating. | |
| hb.start(); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment