Jelajahi Sumber

update config

zhangweicheng 7 tahun lalu
induk
melakukan
96bf85938a
2 mengubah file dengan 14 tambahan dan 10 penghapusan
  1. 13 9
      config/config.js
  2. 1 1
      config/db/db_manager.js

+ 13 - 9
config/config.js

@@ -1,15 +1,19 @@
 module.exports = {
     current: {server: "192.168.1.184", port: "60666",redis:{server:'192.168.1.184',port:'6379',pwd:'smartCost'}},
     local: {server: "localhost", port: "27017"},
-    qa: {server: "192.168.1.184", port: "60666", options:{
-        user:'smartcost',
-        pass:'smartcost3850888',
-        auth: {
-            "authdb": "admin"
-        },
-        connectTimeoutMS: 20000,
-        useMongoClient: true
-    }},
+    qa: {
+        server: "192.168.1.184",
+        port: "60666",
+        options:{
+            user:'smartcost',
+            pass:'smartcost3850888',
+            auth: {
+                "authdb": "admin"
+              },
+            connectTimeoutMS: 20000,
+            useMongoClient: true
+        }
+    },
     test_auth: {
             server: "120.78.150.216",
             port: "27017",

+ 1 - 1
config/db/db_manager.js

@@ -48,7 +48,7 @@ module.exports = {
     },
     connect:function (env="local") {
         var config = require("../config.js");
-        var dbURL = 'mongodb://' + config.current.server + ":" + config.current.port + '/scConstruct';
+        var dbURL = 'mongodb://' + config[env].server + ":" + config[env].port + '/scConstruct';
         if(config[env].options){
             mg.connect(dbURL,config[env].options);
         }else {