aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app.js b/app.js
index 5bc039d..3d7cef3 100644
--- a/app.js
+++ b/app.js
@@ -21,7 +21,11 @@ var port = process.env.PORT || 8000
// Bootstrap db connection
mongoose.connect(config.db);
-
+var db = mongoose.connection;
+db.on('error', console.error.bind(console, 'connection error:'));
+db.once('open', function callback(){
+ console.log('Connected to MongoDB');
+});
// Bootstrap models
var models_path = __dirname + '/models';