function getEndpoints()

in web/src/js/gcping.js [55:76]


function getEndpoints() {
  fetch("/api/endpoints")
    .then(function (resp) {
      return resp.json();
    })
    .then(function (endpoints) {
      for (const zone of Object.values(endpoints)) {
        const gcpZone = {
          key: zone.Region,
          label: zone.RegionName,
          pingUrl: zone.URL + "/api/ping",
          latencies: [],
          median: "",
        };

        regions[gcpZone.key] = gcpZone;
      }

      // once we're done fetching all endpoints, let's start pinging
      pingAllRegions(INITIAL_ITERATIONS);
    });
}