lib/commands/buildServerCmd.js
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))
    }
}
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))
    }
}
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 ) ) } }
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}
Builds a Server wrapper interface from a config to provide basic standard controls for varying server types