diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-03-04 16:49:41 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-03-04 16:49:41 +0100 |
| commit | 4ed70beabc73dd9aa1d2e06ab5902ded0801c404 (patch) | |
| tree | 05fb731e5c937be885c6d03f31f40f1f9fd2cf8c /src/utils/config.ts | |
| parent | 4378c4553b17d5435b08387d80377bce666dc838 (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 'src/utils/config.ts')
| -rw-r--r-- | src/utils/config.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/utils/config.ts b/src/utils/config.ts index 5928f02..874a24c 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,9 +1,16 @@ +const isStaging = process.env.NEXT_PUBLIC_APP_ENV === 'staging'; + export const settings = { ackee: { filename: process.env.NEXT_PUBLIC_ACKEE_FILENAME || 'tracker.js', siteId: process.env.NEXT_PUBLIC_ACKEE_SITE_ID || '', url: `https://${process.env.NEXT_PUBLIC_ACKEE_DOMAIN}` || '', }, + api: { + url: isStaging + ? process.env.NEXT_PUBLIC_STAGING_GRAPHQL_API + : process.env.NEXT_PUBLIC_GRAPHQL_API, + }, name: 'Armand Philippot', baseline: { en: 'Front-end developer', @@ -20,5 +27,8 @@ export const settings = { }, postsPerPage: 10, twitterId: '@ArmandPhilippot', - url: `${process.env.NEXT_PUBLIC_APP_PROTOCOL}://${process.env.NEXT_PUBLIC_APP_DOMAIN}`, + url: + (isStaging + ? process.env.NEXT_PUBLIC_STAGING_APP_URL + : process.env.NEXT_PUBLIC_APP_URL) || '', }; |
