mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-23 01:54:18 -08:00
Modify env var in development
- add a score path env variable to development - this will allow the dev to run the app using both local data or cdn
This commit is contained in:
parent
078bf6d8b6
commit
3e31959ae1
2 changed files with 8 additions and 2 deletions
|
@ -6,7 +6,9 @@
|
|||
GATSBY_CDN_TILES_BASE_URL=https://d3jqyw10j8e7p9.cloudfront.net
|
||||
GATSBY_LOCAL_TILES_BASE_URL=http://localhost:5000/data/data-pipeline
|
||||
|
||||
GATSBY_DATA_PIPELINE_SCORE_PATH_LOCAL=data_pipeline/data/score
|
||||
GATSBY_DATA_PIPELINE_SCORE_PATH=data-pipeline/data/score
|
||||
|
||||
GATSBY_SCORE_DOWNLOAD_FILE_PATH=downloadable/Screening_Tool_Data.zip
|
||||
GATSBY_MAP_TILES_PATH=tiles
|
||||
|
||||
|
|
|
@ -4,15 +4,19 @@ import {isMobile as isMobileReactDeviceDetect} from 'react-device-detect';
|
|||
|
||||
const XYZ_SUFFIX = '{z}/{x}/{y}.pbf';
|
||||
export const featureURLForTilesetName = (tilesetName: string): string => {
|
||||
// The feature tile base URL can either point locally or the CDN.
|
||||
// The feature tile base URL and path can either point locally or the CDN.
|
||||
// This is selected based on the DATA_SOURCE env variable.
|
||||
const featureTileBaseURL = process.env.DATA_SOURCE === 'local' ?
|
||||
process.env.GATSBY_LOCAL_TILES_BASE_URL :
|
||||
process.env.GATSBY_CDN_TILES_BASE_URL;
|
||||
|
||||
const featureTilePath = process.env.DATA_SOURCE === 'local' ?
|
||||
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH_LOCAL :
|
||||
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH;
|
||||
|
||||
return [
|
||||
featureTileBaseURL,
|
||||
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH,
|
||||
featureTilePath,
|
||||
process.env.GATSBY_MAP_TILES_PATH,
|
||||
tilesetName,
|
||||
XYZ_SUFFIX,
|
||||
|
|
Loading…
Add table
Reference in a new issue