Skip to content

Commit

Permalink
Look for environment-specific UIO landing URLs first
Browse files Browse the repository at this point in the history
This PR looks for a new environment variable to use as the UIO landing URL. If not found, it falls back to the current production/public UIO landing URL.
  • Loading branch information
kalvinwang authored Aug 19, 2021
2 parents f9e28e3 + 4aa562e commit 2545e0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ relates to weekly certification
- CERTIFICATE_DIR: The path to the client certificate (certificate must be in PFX/P12 format)
- PFX_FILE: The name of the client certificate file
- (Optional) PFX_PASSPHRASE: The import passphrase for the client certificate if there is one
- (Optional) URL_UIO_LANDING, URL_UIOMOBILE_LANDING: The environment-specific links to the UIO and UIO Mobile landing pages

For local development:

Expand Down
4 changes: 4 additions & 0 deletions utils/getUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export type UrlType = keyof typeof urls
* Get url from urls.json
*/
export default function getUrl(linkKey: string): string | undefined {
// Optional environment-specific links back to the UIO landing page, used by EDD testing
if (linkKey === 'uio-home-url-desktop' && process.env.URL_UIO_LANDING) return process.env.URL_UIO_LANDING
if (linkKey === 'uio-home-url-mobile' && process.env.URL_UIOMOBILE_LANDING) return process.env.URL_UIOMOBILE_LANDING

// Explicitly cast to one of the allowed keys in urls.json.
// If the key does not exist in urls.json, this function will return undefined.
const key = linkKey as UrlType
Expand Down

0 comments on commit 2545e0d

Please sign in to comment.