Skip to content

Instantly share code, notes, and snippets.

@Kami
Created March 20, 2013 23:21
Show Gist options
  • Select an option

  • Save Kami/5209441 to your computer and use it in GitHub Desktop.

Select an option

Save Kami/5209441 to your computer and use it in GitHub Desktop.
Service Registry - register a service (old way)
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