Cannot connect to mongoDB null.<anonymous>

So node.js keeps throwing:

Error: failed to connect to [domainName.io:27017]
    at null.<anonymous> (/var/www/domainName.io/public_html/programming/projects/timeTracker/node_modules/mongojs/node_modules/mongodb/lib/mongodb/connection/server.js:555:74)
    at emit (events.js:106:17)
    at null.<anonymous> (/var/www/domainName.io/public_html/programming/projects/timeTracker/node_modules/mongojs/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
    at emit (events.js:98:17)
    at Socket.<anonymous> (/var/www/domainName.io/public_html/programming/projects/timeTracker/node_modules/mongojs/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
    at Socket.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:442:13

I am using the following server.js file to spawn http server and connect to mongoDB

 var
  2     http = require("http"),
  3     mongojs = require("mongojs");
  4
  5                 var
  6     uri ="mongodb://userName:password@domainName.io/mydb",
  7     db = mongojs.connect(uri, ["activities"]);
  8
  9 var
 10     server = http.createServer(requestHandler);
 11
 12
 13 function requestHandler(request, response) {
 14         response.writeHead(200, {"Content-Type": "text/html"});
 15         db.activities.find({"name":"mongoDB"}, function(err, records) {
 16             if(err) {
 17                 console.log("There was an error executing the database quer    y.");
 18                 response.end();
 19                 return;
 20             }
 21
 22         var
 23             html = '<h2> Activities </h2>',
 24             i = records.length;
 25
 26         while (i--){
 27                 html += '<p><b>Name:</b> '
 28                      + rescords[i].name
 29                      + ' <br /><b>Time:</b> '
 30                      + records[i].time;
 31         }
 32         response.write(html);
 33         response.end();
 34 });
 35 };
 36
 37 server.listen(8888);

This is my first attempt at running mongoDB with nodeJS so not too sure how to trouble shoot this. I am using the default mongodb port 27017 and created user I believe properly:

> use mydb
>db.createUser({user:"userName",pwd:"password"...})

any help or direction to go forht and try to debug would be awesome.

Problem solved! I am running Debian 7 and had to simply go to /etc/mongod.conf and comment out the following line:

# Listen to local interface only. Comment out to listen on all interfaces.
#bind_ip = 127.0.0.1

Everything is working as it should now. Hope this helps someone in the future!