chore: modify dev config

This commit is contained in:
suxiaoxin 2017-07-17 13:47:46 +08:00
parent a525c435d4
commit cad35e4527
2 changed files with 8 additions and 3 deletions

View File

@ -3,9 +3,11 @@
"webhost": "127.0.0.1", "webhost": "127.0.0.1",
"adminAccount": "admin@admin.com", "adminAccount": "admin@admin.com",
"db": { "db": {
"servername": "127.0.0.1", "servername": "10.86.40.194",
"DATABASE": "yapi", "DATABASE": "yapi",
"port": 27017 "port": 27017,
"user": "admin",
"pass": "qunar.com"
}, },
"mail": { "mail": {
"host": "smtp.163.com", "host": "smtp.163.com",

View File

@ -16,7 +16,10 @@ function connect(){
mongoose.Promise = global.Promise; mongoose.Promise = global.Promise;
let config = yapi.WEBCONFIG; let config = yapi.WEBCONFIG;
let db = mongoose.connect(`mongodb://${config.db.servername}:${config.db.port}/${config.db.DATABASE}`); let db = mongoose.connect(`mongodb://${config.db.servername}:${config.db.port}/${config.db.DATABASE}`, {
user: config.db.user,
pass: config.db.pass
});
db.then(function (res) { db.then(function (res) {
yapi.commons.log('mongodb load success...') yapi.commons.log('mongodb load success...')