Builds a Server wrapper interface from a config to provide basic standard controls for varying server types
@param config {HttpConfig|HttpsConfig} a supported configuration for building a server
@returns {Q.promise}
768035
function buildServerCmd(config) {
    var deferred = Q.defer()
      , app

    try {
        assertConfig(config)
        app = createMiddleware(config)
        createServer(config, app).then(onServerCreated, deferred.reject)
    } catch(error) {
        deferred.reject(error)
    }

    return deferred.promise

    function onServerCreated(server) {
        deferred.resolve(new Server(config, server, app))
    }
}
596306
function startServer() {
    var defer = q.defer();

    var serverConfig = {
        server: {
            baseDir: wpath,
            directory: true
        },
        startPath: 'docs/index.html',
        // browser: "google chrome",
        logPrefix: 'SERVER'
    };
    browserSync.init(serverConfig, defer.resolve);

    return defer.promise;
}
622451
public OperationFuture<ServerMetadata> importServer(ImportServerConfig config) {
        BaseServerResponse response = client.importServer(
            serverConverter.buildImportServerRequest(
                config,
                config.getCustomFields().isEmpty() ?
                    null :
                    client.getCustomFields()
            )
        );

        return postProcessBuildServerResponse(response, config);
    }
546203
public static Javalin create(Consumer<JavalinConfig> config) {
        Javalin app = new Javalin();
        JavalinConfig.applyUserConfig(app, app.config, config); // mutates app.config and app (adds http-handlers)
        if (app.config.logIfServerNotStarted) {
            Util.logIfServerNotStarted(app.server);
        }
        return app;
    }
315545
function getConfig(config) {
  const logger = require('@blackbaud/skyux-logger');
  const minimist = require('minimist');
  const argv = minimist(process.argv.slice(2));
  require(`./${argv.watch ? 'watch' : 'test'}.karma.conf`)(config);
  let skyPagesConfig = require('../sky-pages/sky-pages.config').getSkyPagesConfig(argv._[0]);
  let testWebpackConfig = require('../webpack/test.webpack.config');
  const path = require('path');
  const pactServers = require('../../utils/pact-servers');

  skyPagesConfig.runtime.pactConfig = {};
  skyPagesConfig.runtime.pactConfig.providers = pactServers.getAllPactServers();
  skyPagesConfig.runtime.pactConfig.pactProxyServer = pactServers.getPactProxyServer();

  if (skyPagesConfig.skyux.pacts) {
    var i = 0;
    skyPagesConfig.skyux.pacts.forEach((pact) => {
      // set pact settings not specified in config file
      pact.log = pact.log || path.resolve(process.cwd(), 'logs', `pact-${pact.provider}.log`);
      pact.dir = pact.dir || path.resolve(process.cwd(), 'pacts');
      pact.host = pactServers.getPactServer(pact.provider).host;
      pact.port = pactServers.getPactServer(pact.provider).port;
      pact.pactFileWriteMode = pact.pactFileWriteMode || 'overwrite';

      i++;
    });
  } else {
    logger.error('No pact entry in configuration!');
  }

  config.set({
    frameworks: config.frameworks.concat('pact'),
    files: config.files.concat(path.resolve(process.cwd(), 'node_modules/@pact-foundation/pact-web',
    `pact-web.js`)),
    pact: skyPagesConfig.skyux.pacts,
    plugins: config.plugins.concat('@pact-foundation/karma-pact'),
    webpack: testWebpackConfig.getWebpackConfig(skyPagesConfig, argv)

  });

}
38455
public HttpServerActionBuilder server(HttpServer httpServer) {
		HttpServerActionBuilder serverAction = new HttpServerActionBuilder(action, httpServer)
				.withApplicationContext(applicationContext);
		return serverAction;
	}
385252
function Builder (config) {
  if (!(config instanceof Config)) {
    config = new Config(config)
  }
  this.config = config
  // TODO: check for root.val
  if (!this.config.native.root) {
    // TODO: simplify this set
    this.config.native.set({
      root: {
        val: process.cwd()
      }
    })
  }
}
376417
public OperationFuture<ServerMetadata> create(CreateServerConfig config) {
        BaseServerResponse response = client.create(
            serverConverter.buildCreateServerRequest(
                config,
                config.getCustomFields().isEmpty() ?
                    null :
                    client.getCustomFields())
        );

        return postProcessBuildServerResponse(response, config);
    }
919337
public static TopologyAPI.Config.Builder getConfigBuilder(Config config) {
    TopologyAPI.Config.Builder cBldr = TopologyAPI.Config.newBuilder();
    Set<String> apiVars = config.getApiVars();
    for (String key : config.keySet()) {
      if (key == null) {
        LOG.warning("ignore: null config key found");
        continue;
      }
      Object value = config.get(key);
      if (value == null) {
        LOG.warning("ignore: config key " + key + " has null value");
        continue;
      }
      TopologyAPI.Config.KeyValue.Builder b = TopologyAPI.Config.KeyValue.newBuilder();
      b.setKey(key);
      if (apiVars.contains(key)) {
        b.setType(TopologyAPI.ConfigValueType.STRING_VALUE);
        b.setValue(value.toString());
      } else {
        b.setType(TopologyAPI.ConfigValueType.JAVA_SERIALIZED_VALUE);
        b.setSerializedValue(ByteString.copyFrom(serialize(value)));
      }
      cBldr.addKvs(b);
    }

    return cBldr;
  }
837004
function(config) {
        var path = require("path"),
            modulepfx = path.dirname(module.filename),
            responsesdefault = path.join(modulepfx, "responses"),
            resourcesdefault = path.join(modulepfx, "resources");
        
        config = config || {};
        config.resources = config.resources || resourcesdefault;
        config.responses = config.responses || responsesdefault;
        config.responsesdefault = responsesdefault;
        config.resourcesdefault = resourcesdefault;
        this.config = config;
        return this;
    }
422581
function compile(config) {
  return new Promise((resolve, reject) => {
    let compiler;
    try {
      compiler = webpack(config);
    } catch (e) {
      console.log('compile errors:', [e]); // eslint-disable-line
      reject(e);
      process.exit(1);
    }
    compiler.run((err, stats) => {
      err ? reject(err) : resolve(stats);
    });
  });
}
1079789
function readServerConfig( server ) {
  try {
    const severConfig = getConfig( appSeverConfig );
    return Right( Object.assign( server, severConfig ));
  } catch ( e ) {
    print(
      chalk.red( `Failed to read ${SEVER_CONFIG}.` ),
      e.message
    );
    print();
    return Left( null );
  }
}
1365442
function Builder(baseURL, cfg) {
  if (typeof baseURL == 'object') {
    cfg = baseURL;
    baseURL = null;
  }

  this.loader = null;
  this.resetConfig = function() {};

  this.reset();

  if (baseURL)
    this.config({ baseURL: baseURL });

  // config passed to constructor will
  // be saved for future .reset() calls
  if (typeof cfg == 'object')
    this.config(cfg, true, !!baseURL);
  else if (typeof cfg == 'string')
    this.loadConfigSync(cfg, true, !!baseURL);
}
1188968
function XAPIWrapper(config) {
    if (!config) {
        throw new Error("config was not defined");
    }

    if (!config.url) {
        throw new Error("config.url was not defined");
    }

    if (!config.auth) {
        throw new Error("config.auth was not defined");
    }

    if (!((config.auth.user || config.auth.username) && (config.auth.pass || config.auth.password))) {
        throw new Error("config.auth does not have user or pass");
    }

    this.config = config;
}
375664
function checkConfig (config) {
    if (config) {
        if (!util.isObject(config)) {
            throw new CartoValidationError('\'config\' property must be an object.', CartoValidationErrorTypes.INCORRECT_TYPE);
        }
        _checkServerURL(config.serverURL);
    }
}
147111
function browserBuild(config) {
  const compiler = webpack(config);
  return new Promise((resolve, reject) => {
    compiler.run((err, stats) => {
      if (err) {
        return reject(err);
      }
      const messages = formatWebpackMessages(stats.toJson({}, true));
      if (messages.errors.length) {
        return reject(new Error(messages.errors.join('\n\n')));
      }
      return resolve({ stats, warnings: messages.warnings });
    });
  });
}
845646
function configureDevServer(config) {
  if (borela !== 'serve')
    return
  config.devServer = {
    contentBase: PROJECT_BUILD_DIR,
    headers: {
      'Access-Control-Allow-Headers': '*',
      'Access-Control-Allow-Methods': '*',
      'Access-Control-Allow-Origin': '*',
    },
    index: 'index.html',
    stats: config.stats,
    watchContentBase: true,
    port,
  }
}