Skip to content

Commit

Permalink
🚀 Added Gateway URL to environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
abdheshnayak committed Dec 19, 2023
1 parent e9913b7 commit 813f012
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/app-setup/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ export const loader = () => {

...(process.env.URL_SUFFIX ? { URL_SUFFIX: process.env.URL_SUFFIX } : {}),
...(process.env.BASE_URL ? { BASE_URL: process.env.BASE_URL } : {}),
...(process.env.GATEWAY_URL
? { GATEWAY_URL: process.env.GATEWAY_URL }
: {}),
};
};

Expand Down
11 changes: 10 additions & 1 deletion lib/configs/base-url.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ const baseUrls = () => {
return process.env.COOKIE_DOMAIN;
})() || '.kloudlite.io';

const gatewayUrl =
(() => {
if (typeof window !== 'undefined') {
// @ts-ignore
return window.GATEWAY_URL;
}
return process.env.GATEWAY_URL;
})() || 'http://gateway-api.kl-core.svc.cluster.local';

return {
gatewayUrl: 'http://gateway-api.kl-core.svc.cluster.local',
gatewayUrl,
authBaseUrl: `https://auth${postFix}.${bUrl}`,
consoleBaseUrl: `https://console${postFix}.${bUrl}`,
cookieDomain,
Expand Down

0 comments on commit 813f012

Please sign in to comment.