Permalink
Browse files

Connect ExpressJS to MongoDB

  • Loading branch information...
amejiarosario committed Oct 2, 2014
1 parent 624424c commit d3be6a287e8aff39ab862971da4f050d04e552a1
Showing with 10 additions and 0 deletions.
  1. +9 −0 app.js
  2. +1 −0 package.json
View
9 app.js
@@ -8,6 +8,15 @@ var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/todoApp', function(err) {
if(err) {
console.log('connection error', err);
} else {
console.log('connection successful');
}
});
var app = express();
// view engine setup
View
@@ -11,6 +11,7 @@
"debug": "~2.0.0",
"ejs": "~0.8.5",
"express": "~4.9.0",
"mongoose": "^3.8.17",
"morgan": "~1.3.0",
"serve-favicon": "~2.1.3"
}

0 comments on commit d3be6a2

Please sign in to comment.