for those of you out there trying to replicate this project and encountering similar issues, in server.js, replace this code:
// db config
var mongoDB = 'mongodb://:@ds257485.mlab.com:57485/merncommentbox';
mongoose.connect(mongoDB, { useMongoClient: true })
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
I wasn't able to connect to mongolab using the syntax/set-up instructions in the readme...
the 'GET' route (and 'POST') to http://localhost:3001/api/comments in postman was timing out due to failed connection
for those of you out there trying to replicate this project and encountering similar issues, in server.js, replace this code: // db config var mongoDB = 'mongodb://:@ds257485.mlab.com:57485/merncommentbox';
mongoose.connect(mongoDB, { useMongoClient: true })
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
with: mongoose.Promise = global.Promise; mongoose.connect( process.env.MONGODB_URI || "mongodb://localhost/",
{
useMongoClient: true
}
);