From 2620f4a682923db8491f70ca3ae5d307b37ddd60 Mon Sep 17 00:00:00 2001 From: Duyet Le Date: Mon, 23 Mar 2020 09:24:13 +0700 Subject: [PATCH] PROJECT_ID --- functions/utils/config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/utils/config.js b/functions/utils/config.js index 6e699f67..cfd6d3dd 100644 --- a/functions/utils/config.js +++ b/functions/utils/config.js @@ -26,6 +26,8 @@ const getSortKey = key => { return key } +// TODO: Get PROJECT_ID from env +const PROJECT_ID = 'duyet-price-tracker' const IS_PROD = process.env.FUNCTION_TARGET ? true : false console.log(`IS_PROD: ${IS_PROD} ` @@ -38,10 +40,10 @@ console.log(`IS_PROD: ${IS_PROD} ` */ const functionsUrl = !IS_PROD ? `http://localhost:5001/duyet-price-tracker/us-central1` - : `https://us-central1-${process.env.FUNCTION_TARGET}.cloudfunctions.net` + : `https://us-central1-${PROJECT_ID}.cloudfunctions.net` const functionsUrlAsia = !IS_PROD ? `http://localhost:5001/duyet-price-tracker/us-central1` - : `https://asia-northeast1-${process.env.FUNCTION_TARGET}.cloudfunctions.net` + : `https://asia-northeast1-${PROJECT_ID}.cloudfunctions.net` /**