Skip to content

Commit

Permalink
PROJECT_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
duyet committed Mar 23, 2020
1 parent 2804aba commit 2620f4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions functions/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} `
Expand All @@ -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`


/**
Expand Down

0 comments on commit 2620f4a

Please sign in to comment.