yapi本地部署报错,报错信息为mongodb Authentication failed
修复
config.json中db对象增加"connectString":"mongodb://localhost/yapi",
"db": {
"connectString":"mongodb://localhost/yapi",
"servername": "127.0.0.1",
"DATABASE": "yapi",
"port": 27017,
"user": "test1",
"pass": "test1",
"authSource": ""
},
修改 vendors/server/utils/db.js
中mongoose.connect
的相关参数,如下:
let db = mongoose.connect(
connectString,
// options,
{useMongoClient: true,poolSize: 20},
function(err) {
if (err) {
yapi.commons.log(err + ', mongodb Authentication failed', 'error');
}
}
);
最后
可以按照文档上运行了