lib/models/user.js
function validateAndCbBackend (instance, urlPort, cb) {
  var backendUrl = instance.dockerUrlForPort(urlPort);
  var err = validateContainer(instance.attrs.container);
  if (err) {
    return cb(err); }
  if (!backendUrl) {
    err = Boom.create(400, 'port not exposed', urlPort);
    return cb(err);
  }

  cb(null, backendUrl);
}
function validateAndCbBackend (instance, urlPort, cb) {
  var backendUrl = instance.dockerUrlForPort(urlPort);
  var err = validateContainer(instance.attrs.container);
  if (err) {
    return cb(err); }
  if (!backendUrl) {
    err = Boom.create(400, 'port not exposed', urlPort);
    return cb(err);
  }

  cb(null, backendUrl);
}
function validateAndCbBackend ( instance , urlPort , cb ) { var backendUrl = instance . dockerUrlForPort ( urlPort ) ; var err = validateContainer ( instance . attrs . container ) ; if ( err ) { return cb ( err ) ; } if ( ! backendUrl ) { err = Boom . create ( 400 , 'port not exposed' , urlPort ) ; return cb ( err ) ; } cb ( null , backendUrl ) ; }
private function that gets the backend url of an instance and verifies the port is exposed
@param  {Object}    instance  instance model
@param  {Function}  cb        callback
private function that gets the backend url of an instance and verifies the port is exposed