aboutsummaryrefslogtreecommitdiffhomepage
path: root/application
diff options
context:
space:
mode:
authorNick Coutsos <[email protected]>2022-04-15 12:20:05 -0400
committerNick Coutsos <[email protected]>2022-04-15 12:20:05 -0400
commitd38567dfe277d9eacc8b831e72b82afd75bf728e (patch)
tree362d5ab47d3a6d06d7db531a6096e35e8465a290 /application
parent9ee6b5db661e22c559a0a6b8fcddb51552b7caf5 (diff)
downloadkeymap-editor-d38567dfe277d9eacc8b831e72b82afd75bf728e.tar.gz
keymap-editor-d38567dfe277d9eacc8b831e72b82afd75bf728e.zip
Start porting frontend to react
Diffstat (limited to 'application')
-rw-r--r--application/config.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/application/config.js b/application/config.js
index 8b513cc..eae363c 100644
--- a/application/config.js
+++ b/application/config.js
@@ -2,8 +2,12 @@ function parseBoolean (val) {
return val && ['1', 'on', 'yes', 'true'].includes(val.toString().toLowerCase())
}
-export const apiBaseUrl = process.env.API_BASE_URL
-export const appBaseUrl = process.env.APP_BASE_URL
-export const githubAppName = process.env.GITHUB_APP_NAME
-export const enableGitHub = parseBoolean(process.env.ENABLE_GITHUB)
-export const enableLocal = parseBoolean(process.env.ENABLE_LOCAL)
+function env(key) {
+ return process.env[key] || process.env[`REACT_APP_${key}`]
+}
+
+export const apiBaseUrl = env('API_BASE_URL')
+export const appBaseUrl = env('APP_BASE_URL')
+export const githubAppName = env('GITHUB_APP_NAME')
+export const enableGitHub = parseBoolean(env('ENABLE_GITHUB'))
+export const enableLocal = parseBoolean(env('ENABLE_LOCAL'))