Skip to content

Commit

Permalink
refactor: change parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofsl committed Jun 21, 2022
1 parent f3dc659 commit 065aea8
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions js/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,42 @@ export const getRipeWhiteAdminOptions = (environment, fallback = {}) => {
}
};

export const getRipeConfigOptions = (url = null) => {
return {
url: url || "https://config.platforme.com/"
};
export const getRipeConfigOptions = (environment, fallback = {}) => {
switch (environment) {
case "ci":
case "test":
case "now":
case "now-branch":
case "sandbox":
case "stage":
return {
baseUrl: "https://master--ripe-config.netlify.app"
};
case "production":
return {
baseUrl: "https://config.platforme.com/"
};
default:
return fallback;
}
};

export const getRipeConfigPublicOptions = (url = null) => {
return {
url: url || "https://config-public.platforme.com/"
};
export const getRipeConfigPublicOptions = (environment, fallback = {}) => {
switch (environment) {
case "ci":
case "test":
case "now":
case "now-branch":
case "sandbox":
case "stage":
return {
baseUrl: "https://master--ripe-config-public.netlify.app"
};
case "production":
return {
baseUrl: "https://config-public.platforme.com/"
};
default:
return fallback;
}
};

0 comments on commit 065aea8

Please sign in to comment.