From d68d7b8034f0bd5d6bd2b741a83e185346d144e9 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Mon, 7 Aug 2023 14:20:36 +0900 Subject: [PATCH] =?UTF-8?q?config=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=ABAPP=5FENV=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/config.ts b/src/config.ts index 1076237..ead6938 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,3 +1,12 @@ +function getEnv() { + const e = process.env.REACT_APP_ENV; + if (e === "local") return e; + if (e === "staging") return e; + if (e === "production") return e; + return "other"; +} + +export const APP_ENV: "local" | "staging" | "production" | "other" = getEnv(); // API // ---------------------------------------------------------------------- export const HOST_API = process.env.REACT_APP_HOST_API_KEY || "";