async function fetchConfig()

in source/4-landing-page-with-feedback-api/ui/src/services.ts [9:22]


async function fetchConfig(url = 'config.json') {
  if(!config.API_URL) {
      try {
          const response = await fetch(url);
          config = await response.json();
          console.debug("(Loading config.json) config.json content = ", config);
          return config;
        } catch (e) {
          console.error(`error loading json ${e}`);
        }
  } else {
      return config;
  } 
}