So I'm on a macbook running mongodb locally. Mongodb is listening on port 27017 and I can see it saying it's ready to accept connections. If I open a mongo shell, I can see it shows the connection. When I run "node index.js", the program just hangs and doesn't show and error or it doesn't show connected. Also, in the mongo server tab I can see connections accepted
Here's my code:
var express = require('express');
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var _ = require('lodash');
//create application
var app = express();
//add middleware
app.use(bodyParser.urlencoded({extended:true}));
app.use(bodyParser.json());
app.use(methodOverride('X-HTTP-Method-Overrise'));
mongoose.connect('mongodb://localhost:27017/boost', function(err) {
if (err) {
console.log(err);
}else{
console.log("Connected");
}
});