lib/smartrouter.js
function () {
    var self = this;
    self.config.endpoints.forEach(function (endpoint) {
      logger.info(util.format('Registering endpoint %s', endpoint.name));
      endpoint.sub = endpoint.sub || endpoint.ids; // backward compatibility....
      if (endpoint.sub.length === 0) {
        var socketendpoint = self.io.of('/' + endpoint.name);
        logger.info(util.format('Endpoint registered on [/%s]', endpoint.name));
        self.registerRoutes(endpoint.name, '', endpoint.queue, socketendpoint);
      } else {
        endpoint.sub.forEach(function (sub) {
          var socketendpoint = self.io.of(util.format('/%s/%s', endpoint.name, sub));
          logger.info(util.format('Endpoint registered on [/%s/%s]', endpoint.name, sub));
          self.registerRoutes(endpoint.name, sub, endpoint.queue, socketendpoint);
        });
      }
    });
  }
function () {
    var self = this;
    self.config.endpoints.forEach(function (endpoint) {
      logger.info(util.format('Registering endpoint %s', endpoint.name));
      endpoint.sub = endpoint.sub || endpoint.ids; // backward compatibility....
      if (endpoint.sub.length === 0) {
        var socketendpoint = self.io.of('/' + endpoint.name);
        logger.info(util.format('Endpoint registered on [/%s]', endpoint.name));
        self.registerRoutes(endpoint.name, '', endpoint.queue, socketendpoint);
      } else {
        endpoint.sub.forEach(function (sub) {
          var socketendpoint = self.io.of(util.format('/%s/%s', endpoint.name, sub));
          logger.info(util.format('Endpoint registered on [/%s/%s]', endpoint.name, sub));
          self.registerRoutes(endpoint.name, sub, endpoint.queue, socketendpoint);
        });
      }
    });
  }
registerEndpoints: register bindings for the endpoints.