@stackfactor/client-api 1.1.49 → 1.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/utils.js +11 -9
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -20,15 +20,17 @@ export const objectToArray = (data) => {
20
20
  */
21
21
  export const getBaseUrl = () => {
22
22
  console.log("Environment", process.env.REACT_APP_NODE_ENV);
23
- if (
24
- !process.env.REACT_APP_NODE_ENV ||
25
- process.env.REACT_APP_NODE_ENV === "development"
26
- ) {
27
- return "http://localhost:3100/";
28
- } else if (process.env.REACT_APP_NODE_ENV === "testing") {
29
- return "https://qaapi.stackfactor.ai/";
30
- } else {
31
- return "https://api.stackfactor.ai/";
23
+ switch (process.env.REACT_APP_NODE_ENV) {
24
+ case "development":
25
+ case null:
26
+ case undefined:
27
+ return "http://localhost:3100/";
28
+ case "testing":
29
+ return "https://qaapi.stackfactor.ai/";
30
+ case "production":
31
+ return "https://api.stackfactor.ai/";
32
+ default:
33
+ throw new Error("Invalid environment");
32
34
  }
33
35
  };
34
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.49",
3
+ "version": "1.1.50",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {