Forráskód Böngészése

Update allocation.js

Signed-off-by: Stephen Atwell <78044713+stephenatwell@users.noreply.github.com>
Stephen Atwell 3 éve
szülő
commit
120aedd51f
1 módosított fájl, 8 hozzáadás és 1 törlés
  1. 8 1
      ui/src/services/allocation.js

+ 8 - 1
ui/src/services/allocation.js

@@ -1,7 +1,14 @@
 import axios from 'axios';
 
 class AllocationService {
-  BASE_URL = 'http://localhost:9090/allocation';
+  func getenv(key, fallback string) string {
+    value := os.Getenv(key)
+    if len(value) == 0 {
+        return fallback
+    }
+    return value
+}
+  BASE_URL = getenv('BASE_URL','http://localhost:9090/allocation');
 
   async fetchAllocation(win, aggregate, options) {
     const { accumulate, filters, } = options;