From b64b4ade269280bd48ea6191d4464b67be1ccb0e Mon Sep 17 00:00:00 2001 From: SpBills <45398785+SpBills@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:35:36 -0400 Subject: [PATCH] Env variables for API urls. Note that we need to migrate this project to TS. We really shouldn't have any JS projects left. We want to use the null coalescing operator here. This should error currently. --- src/utils/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index 25aa633..9527b94 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,8 +1,8 @@ export const COLOR_CEDARVILLE_YELLOW = "#F3A00F"; export const COLOR_CEDARVILLE_BLUE = "#31B7E6"; -export const API_URL = "https://api.cusmartevents.com" //"http://localhost:3001" -export const ENGAGEMENT_WEBHOOK_GIVEAWAY = "https://engagements.cusmartevents.com/webhook/giveaway" //"http://localhost:3001/webhook/giveaway" -export const ENGAGEMENT_WEBHOOK_ANNOUNCEMENT = "https://engagements.cusmartevents.com/webhook/announcement" //"http://localhost:3001/webhook/announcement" +export const API_URL = process.env.API_URL ?? "http://localhost:3001" //"http://localhost:3001" +export const ENGAGEMENT_WEBHOOK_GIVEAWAY = (process.env.ENGAGEMENT_WEBHOOK_ROOT ?? "http://localhost:3001/webhook") + "/giveaway" //"http://localhost:3001/webhook/giveaway" +export const ENGAGEMENT_WEBHOOK_ANNOUNCEMENT = (process.env.ENGAGEMENT_WEBHOOK_ROOT ?? "http://localhost:3001/webhook") + "/announcement" //"http://localhost:3001/webhook/announcement" export const clientId = '787844068457-38ubcdtp9moimvtq3a1du037nphmo8ee.apps.googleusercontent.com';