OpenShift中的日志显示MongoError无法连接到undefined:27017
var mongoose = require('mongoose');
var url = process.env.OPENSHIFT_MONGODB_DB_URL +
process.env.OPENSHIFT_APP_NAME;
mongoose.Promise = global.Promise;
var connect = function () {
mongoose.connect(url);
};
connect();
var db = mongoose.connection;
db.on('error', function(error){
console.log("Error loading the db - "+ error);
});
db.on('disconnected', connect);