From bb5b56be58083f19fc7e8d7f17cf6709f411aac8 Mon Sep 17 00:00:00 2001 From: Philipp Wambach Date: Mon, 9 Mar 2020 17:36:54 +0100 Subject: [PATCH] feat(versioning): load remote data from versioned urls --- src/scripts/config/main.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/scripts/config/main.ts b/src/scripts/config/main.ts index 46c94e116..6973aa65d 100644 --- a/src/scripts/config/main.ts +++ b/src/scripts/config/main.ts @@ -21,20 +21,17 @@ const globeState: GlobeState = { } }; +// @ts-ignore - injected via webpack's define plugin +const version = INFO_VERSION; + export default { api: { - layers: - 'https://storage.googleapis.com/esa-cfs-storage/layers/layers-{lang}.json', - layer: - 'https://storage.googleapis.com/esa-cfs-storage/layers/{id}/metadata.json', - layerTiles: - 'https://storage.googleapis.com/esa-cfs-tiles/test/{id}/{timeIndex}/{z}/{y}/{x}.png', - layerSingleImage: - 'https://storage.googleapis.com/esa-cfs-tiles/test/{id}/{timeIndex}.jpg', - stories: - 'https://storage.googleapis.com/esa-cfs-storage/stories/stories-{lang}.json', - story: - 'https://storage.googleapis.com/esa-cfs-storage/stories/{id}/{id}-{lang}.json' + layers: `https://storage.googleapis.com/esa-cfs-storage/${version}/layers/layers-{lang}.json`, + layer: `https://storage.googleapis.com/esa-cfs-storage/${version}/layers/{id}/metadata.json`, + layerTiles: `https://storage.googleapis.com/esa-cfs-tiles/${version}/{id}/{timeIndex}/{z}/{y}/{x}.png`, + layerSingleImage: `https://storage.googleapis.com/esa-cfs-tiles/${version}/{id}/{timeIndex}.jpg`, + stories: `https://storage.googleapis.com/esa-cfs-storage/${version}/stories/stories-{lang}.json`, + story: `https://storage.googleapis.com/esa-cfs-storage/${version}/stories/{id}/{id}-{lang}.json` }, globe: globeState };