不确定该怎么做,在Git Shell中运行 >>node index.js 时无法连接。它给了我以下信息:
LoL RPG 在端口8080上启动 连接错误:[错误:无法连接到 [undefined:27017]]
/* ==== MONGODB ==== */
var mongoose = require('mongoose');
var db = require('./config/db.js');
mongoose.connect(db.url);
mongoose.connection.on('error', console.error.bind(console, 'connection error:'));
mongoose.connection.once('open', function() { console.log("Mongo DB connected!"); });
/* ==== config/db.js ==== */
module.exports = "mongodb://<username>:<username>@ds052837.mongolab.com:52837/lolrpg";