Skip to content

Commit

Permalink
Uses APP_ENV rather than NEXT_PUBLIC_BUILD_TYPE to generate absolute …
Browse files Browse the repository at this point in the history
…URLs. This needs more consideration going forward, but it is good for now.
  • Loading branch information
ryguyk committed Dec 5, 2023
1 parent 86e9e6c commit 2567b6a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/lib/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { hosts } from '@/lib/constants/environment'

export const generateAbsoluteUrlFromBuildType = (
relativeUrl: string,
buildType: string
appEnv: string
) => {
const host = hosts[buildType]
const host = hosts[appEnv]
if (!host) {
return relativeUrl
}
Expand All @@ -14,7 +14,4 @@ export const generateAbsoluteUrlFromBuildType = (
}

export const generateAbsoluteUrlFromEnv = (relativeUrl: string) =>
generateAbsoluteUrlFromBuildType(
relativeUrl,
process.env.NEXT_PUBLIC_BUILD_TYPE
)
generateAbsoluteUrlFromBuildType(relativeUrl, process.env.APP_ENV)

0 comments on commit 2567b6a

Please sign in to comment.