From c1371f712789e97fac6351daee93a048b12db69b Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Mon, 29 Apr 2013 04:13:18 +0200 Subject: cleaned up router.js --- app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app.js') 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'; -- cgit v1.2.3