const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https';

const hostMap = {
  apiHost: `${protocol}//quantum-blocks.q-gp.com`,
  h5Host: `${protocol}//quantum-h5.q-gp.com`,
  qiniuHost: `${protocol}//appsync.lkbang.net`,
  shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
  opapiHost: `${protocol}//opapi.q-gp.com`,
  qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
};

if (EASY_ENV_IS_BROWSER) {
  const apolloCfg = window.apollo || window.__INITIAL_STATE__.apollo;
  if (apolloCfg) {
    for (const key in apolloCfg) {
      if (apolloCfg[key]) {
        hostMap[key] = apolloCfg[key];
      }
    }
  }
}

export default hostMap;