aboutsummaryrefslogtreecommitdiffstats
path: root/next.config.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-04 16:49:41 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-04 16:49:41 +0100
commit4ed70beabc73dd9aa1d2e06ab5902ded0801c404 (patch)
tree05fb731e5c937be885c6d03f31f40f1f9fd2cf8c /next.config.js
parent4378c4553b17d5435b08387d80377bce666dc838 (diff)
chore: use a different configuration depending on app env
It will be useful with Docker. Instead of cloning the project with a different configuration, I can manage two different configuration thanks to dotenv and some checking inside the app.
Diffstat (limited to 'next.config.js')
-rw-r--r--next.config.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/next.config.js b/next.config.js
index 077d0a0..fc35b57 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,7 +1,12 @@
const path = require('path');
-const backendDomain = process.env.APP_BACKEND_DOMAIN;
-const frontendDomain = process.env.APP_FRONTEND_DOMAIN;
+const isStaging = process.env.NEXT_PUBLIC_APP_ENV === 'staging';
+const backendDomain = isStaging
+ ? process.env.APP_STAGING_BACKEND_DOMAIN
+ : process.env.APP_BACKEND_DOMAIN;
+const frontendDomain = isStaging
+ ? process.env.APP_STAGING_FRONTEND_DOMAIN
+ : process.env.APP_FRONTEND_DOMAIN;
const ackeeDomain = process.env.NEXT_PUBLIC_ACKEE_DOMAIN;
const contentSecurityPolicy = `