getRuntimeConfig()

in source/website/src/main.js [35:98]


getRuntimeConfig().then(function(json) {
  const awsconfig = {
    Auth: {
      region: json.AWS_REGION,
      userPoolId: json.USER_POOL_ID,
      userPoolWebClientId: json.USER_POOL_CLIENT_ID,
      identityPoolId: json.IDENTITY_POOL_ID
    },
    Storage: {
      AWSS3: {
        bucket: json.DATAPLANE_BUCKET,
        region: json.AWS_REGION
      }
    },
    API: {
      endpoints: [
        {
          name: "search",
          endpoint: json.SEARCH_ENDPOINT,
          service: "es",
          region: json.AWS_REGION
        },
        {
          name: "mieWorkflowApi",
          endpoint: json.WORKFLOW_API_ENDPOINT,
          service: "execute-api",
          region: json.AWS_REGION
        },
        {
          name: "mieDataplaneApi",
          endpoint: json.DATAPLANE_API_ENDPOINT,
          service: "execute-api",
          region: json.AWS_REGION
        }
      ]
    }
  };
  console.log("Runtime config: " + JSON.stringify(json));
  Amplify.configure(awsconfig);
  Vue.config.productionTip = false;
  Vue.mixin({
    data() {
      return {
        // Distribute runtime configs into every Vue component
        SEARCH_ENDPOINT: json.SEARCH_ENDPOINT,
        DATAPLANE_API_ENDPOINT: json.DATAPLANE_API_ENDPOINT,
        DATAPLANE_BUCKET: json.DATAPLANE_BUCKET,
        WORKFLOW_API_ENDPOINT: json.WORKFLOW_API_ENDPOINT,
        AWS_REGION: json.AWS_REGION
      }
    },
  });

  Vue.use(AmplifyPlugin, AmplifyModules);
  Vue.use(BootstrapVue);
  Vue.use(BootstrapVueIcons);
  Vue.use(VueHighlightJS)

  new Vue({
    router,
    store,
    render: h => h(App),
  }).$mount('#app')
});