-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
/client/env
API route for sending client env vars as JSON (…
- Loading branch information
Showing
5 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ClientEnvVars } from '../../../../shared/types/core' | ||
import config from '../../config/config' | ||
import { captchaConfig } from '../../config/features/captcha.config' | ||
import { googleAnalyticsConfig } from '../../config/features/google-analytics.config' | ||
import { sentryConfig } from '../../config/features/sentry.config' | ||
import { spcpMyInfoConfig } from '../../config/features/spcp-myinfo.config' | ||
|
||
export const getClientEnvVars = (): ClientEnvVars => { | ||
return { | ||
isGeneralMaintenance: config.isGeneralMaintenance, | ||
isLoginBanner: config.isLoginBanner, | ||
siteBannerContent: config.siteBannerContent, | ||
adminBannerContent: config.adminBannerContent, | ||
logoBucketUrl: config.aws.logoBucketUrl, // S3 bucket | ||
formsgSdkMode: config.formsgSdkMode, | ||
captchaPublicKey: captchaConfig.captchaPublicKey, // Recaptcha | ||
sentryConfigUrl: sentryConfig.sentryConfigUrl, // Sentry.IO | ||
isSPMaintenance: spcpMyInfoConfig.isSPMaintenance, // Singpass maintenance message | ||
isCPMaintenance: spcpMyInfoConfig.isCPMaintenance, // Corppass maintenance message | ||
myInfoBannerContent: spcpMyInfoConfig.myInfoBannerContent, // MyInfo maintenance message | ||
GATrackingID: googleAnalyticsConfig.GATrackingID, | ||
spcpCookieDomain: spcpMyInfoConfig.spcpCookieDomain, // Cookie domain used for removing spcp cookies | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters