title: Cannot connect cluster mongo.db atlas
body: <p>I'm currently trying to learn MEAN stack. The tutorial are about a task manager. Right now I'm trying to connect to mongodb atlas to retrieve sample data in database but they are not showing up <a href="http://localhost:3000/api/tasks" rel="nofollow noreferrer">http://localhost:3000/api/tasks</a></p>
  
  <p>Here is my tasks.js file</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var mongojs = require('mongojs');
  var db = mongojs('drivers',['tasks']);
  
  
  router.get('/tasks', function(req, res, next){
      db.tasks.find(function(err, tasks){
          if(err){
              res.send(err);
          }
          res.json(tasks);
      });
  });
  
  module.exports = router;
  </code></pre>
  
  <p>Here is my server.js file</p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var bodyParser = require('body-parser');
  var index = require('./routes/index');
  var task = require('./routes/tasks');
  var app = express();
  var port = 3000;
  
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'ejs');
  app.engine('html', require('ejs').renderFile);
  
  app.use(express.static(path.join(__dirname, 'client')));
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({extended: false}));
  
  app.use('/', index);
  app.use('/api', task);
  
  app.listen(port, function(){
      console.log('Server started on port' +port);
  });
  </code></pre>
  
  <p>Here is my package.json file</p>
  
  <pre><code>{
    "name": "mytasklist",
    "version": "1.0.0",
    "description": "Task Manager",
    "main": "server.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "",
    "license": "ISC",
    "dependencies": {
      "body-parser": "^1.19.0",
      "ejs": "^2.6.1",
      "express": "^4.17.1",
      "mongojs": "^2.6.0"
    }
  }
  </code></pre>