function Server(config, logger) {
  var that = this;

  // Grab a configuration if present ...
  // ... otherwise supply a default configuration
  this.config = config[name] || {
    address:     defAddress,
    hostname:    defHostname,
    open_port:   defOpenPort,
    secure_port: defSecurePort
  };

  this.logger = logger.addLog(name);

  // Set default values in case where passed config is deficient
  this.config.address     = this.config.address     || defAddress;
  this.config.hostname    = this.config.hostname    || defHostname;
  this.config.open_port   = this.config.open_port   || defOpenPort;
  this.config.secure_port = this.config.secure_port || defSecurePort;
  this.config.protocol    = this.config.production ? 'https' : 'http';

  // Create and configure a server instance
  this.server = restify.createServer()
    .use(restify.jsonp())
    .use(restify.gzipResponse())
    .use(restify.bodyParser());

  this.running = false;
}
/**
 * Constructs a restify based HTTP server.
 *
 * @constructor
 * @param {Object} config                  - a server configuration object
 * @param {String} config.basedir          - the base directory of the server
 * @param {String} [config.address]        - IP address to bind
 * @param {String} [config.hostname]       - hostname to bind
 * @param {String} [config.open_port]      - tcp port to bind
 * @param {String} [config.secure_port]    - tls port to bind
 * @param {Object} [config.https]          - https configuration object
 * @param {String} config.https.key        - location of https private key
 * @param {String} config.https.cert       - location of https certificate
 * @param {String} config.static.directory - location of static content
 */
Constructs a restify based HTTP server.
Constructs a restify based HTTP server .
function Server(config, logger) {
  var that = this;
  this.config = config[name] || {
    address:     defAddress,
    hostname:    defHostname,
    open_port:   defOpenPort,
    secure_port: defSecurePort
  };
  this.logger = logger.addLog(name);
  this.config.address     = this.config.address     || defAddress;
  this.config.hostname    = this.config.hostname    || defHostname;
  this.config.open_port   = this.config.open_port   || defOpenPort;
  this.config.secure_port = this.config.secure_port || defSecurePort;
  this.config.protocol    = this.config.production ? 'https' : 'http';
  this.server = restify.createServer()
    .use(restify.jsonp())
    .use(restify.gzipResponse())
    .use(restify.bodyParser());
  this.running = false;
}
function Server ( config , logger ) { var that = this ; this . config = config [ name ] || { address : defAddress , hostname : defHostname , open_port : defOpenPort , secure_port : defSecurePort } ; this . logger = logger . addLog ( name ) ; this . config . address = this . config . address || defAddress ; this . config . hostname = this . config . hostname || defHostname ; this . config . open_port = this . config . open_port || defOpenPort ; this . config . secure_port = this . config . secure_port || defSecurePort ; this . config . protocol = this . config . production ? 'https' : 'http' ; this . server = restify . createServer ( ) . use ( restify . jsonp ( ) ) . use ( restify . gzipResponse ( ) ) . use ( restify . bodyParser ( ) ) ; this . running = false ; }
Constructs a restify based HTTP server.
Constructs a restify based HTTP server .
// Grab a configuration if present ... // ... otherwise supply a default configuration // Set default values in case where passed config is deficient // Create and configure a server instance