Bladeren bron

Add support for reading httpEndpoint from env

Neeraj Gupta 4 jaren geleden
bovenliggende
commit
35aa74c9fd
1 gewijzigde bestanden met toevoegingen van 2 en 5 verwijderingen
  1. 2 5
      lib/core/configuration.dart

+ 2 - 5
lib/core/configuration.dart

@@ -28,7 +28,7 @@ class Configuration {
   Configuration._privateConstructor();
 
   static final Configuration instance = Configuration._privateConstructor();
-
+  static const endpoint = String.fromEnvironment("endpoint", defaultValue: "https://api.ente.io");
   static const emailKey = "email";
   static const foldersToBackUpKey = "folders_to_back_up";
   static const keyAttributesKey = "key_attributes";
@@ -266,10 +266,7 @@ class Configuration {
   }
 
   String getHttpEndpoint() {
-    // if (kDebugMode) {
-    //   return "http://192.168.1.123:8080";
-    // }
-    return "https://api.ente.io";
+    return endpoint;
   }
 
   String getToken() {