【发布时间】:2018-08-22 12:16:24
【问题描述】:
在尝试用 Swagger 连接 mongodb 时,总是 显示
错误:找不到模块'./config'
var mongoose = require('mongoose'),
sw = require('swagger-node-express'),
config = require('./config'),
db = mongoose.connection;
db.on('error', function() {
console.log('Database connection error'.red);
});
db.on('connecting', function () {
console.log('Database connecting'.cyan);
});
mongoose.connect(config.db_url, {server: {auto_reconnect: true}});
【问题讨论】:
标签: mongodb mongoose swagger mean-stack