utils/host-utils.js
function resolve(url, localUrl, chunks, skyPagesConfig) {
  let host = skyPagesConfig.skyux.host.url;
  let config = {
    scripts: getScripts(chunks),
    localUrl: localUrl
  };

  if (skyPagesConfig.skyux.app && skyPagesConfig.skyux.app.externals) {
    config.externals = skyPagesConfig.skyux.app.externals;
  }

  // Trim leading slash since getAppBase adds it
  if (url && url.charAt(0) === '/') {
    url = url.substring(1);
  }

  // Trim trailing slash since geAppBase adds it
  if (host && host.charAt(host.length - 1) === '/') {
    host = host.slice(0, -1);
  }

  const delimeter = url.indexOf('?') === -1 ? '?' : '&';
  const encoded = new Buffer(JSON.stringify(config)).toString('base64');
  const base = skyPagesConfigUtil.getAppBase(skyPagesConfig);
  const resolved = `${host}${base}${url}${delimeter}local=true&_cfg=${encoded}`;

  return resolved;
}
function resolve(url, localUrl, chunks, skyPagesConfig) {
  let host = skyPagesConfig.skyux.host.url;
  let config = {
    scripts: getScripts(chunks),
    localUrl: localUrl
  };

  if (skyPagesConfig.skyux.app && skyPagesConfig.skyux.app.externals) {
    config.externals = skyPagesConfig.skyux.app.externals;
  }

  // Trim leading slash since getAppBase adds it
  if (url && url.charAt(0) === '/') {
    url = url.substring(1);
  }

  // Trim trailing slash since geAppBase adds it
  if (host && host.charAt(host.length - 1) === '/') {
    host = host.slice(0, -1);
  }

  const delimeter = url.indexOf('?') === -1 ? '?' : '&';
  const encoded = new Buffer(JSON.stringify(config)).toString('base64');
  const base = skyPagesConfigUtil.getAppBase(skyPagesConfig);
  const resolved = `${host}${base}${url}${delimeter}local=true&_cfg=${encoded}`;

  return resolved;
}
function resolve ( url , localUrl , chunks , skyPagesConfig ) { let host = skyPagesConfig . skyux . host . url ; let config = { scripts : getScripts ( chunks ) , localUrl : localUrl } ; if ( skyPagesConfig . skyux . app && skyPagesConfig . skyux . app . externals ) { config . externals = skyPagesConfig . skyux . app . externals ; } // Trim leading slash since getAppBase adds it if ( url && url . charAt ( 0 ) === '/' ) { url = url . substring ( 1 ) ; } // Trim trailing slash since geAppBase adds it if ( host && host . charAt ( host . length - 1 ) === '/' ) { host = host . slice ( 0 , - 1 ) ; } const delimeter = url . indexOf ( '?' ) === - 1 ? '?' : '&' ; const encoded = new Buffer ( JSON . stringify ( config ) ) . toString ( 'base64' ) ; const base = skyPagesConfigUtil . getAppBase ( skyPagesConfig ) ; const resolved = ` ${ host } ${ base } ${ url } ${ delimeter } ${ encoded } ` ; return resolved ; }
Creates a resolved host url.
@param {string} url
@param {string} localUrl
@param {Array} chunks
@param {Object} skyPagesConfig
Creates a resolved host url .