Skip to content

Commit

Permalink
add debug if error happens in count()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Minter committed Dec 7, 2017
1 parent d1af14d commit c8e18b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ app.get('/', function (req, res) {
// Create a document with request IP and current time of request
col.insert({ip: req.ip, date: Date.now()});
col.count(function(err, count){
if (err) {
console.log('Error running count. Message:\n'+err);
}
res.render('index.html', { pageCountMessage : count, dbInfo: dbDetails });
});
} else {
Expand Down

0 comments on commit c8e18b7

Please sign in to comment.