here is the code:
var express = require('express');
var router = express.Router();
var mongojs = require('mongojs');
var db = mongojs('mongodb://mike:mike@localhost:27017/mytasklist', ['tasks']);
router.get('/task/:id', function(req, res, next) {
db.tasks.findOne({ _id: mongojs.ObjectId(req.params.id) }, function(err, task) {
if (err) {
res.send(err);
}
res.json(task);
});
});
MongoDB is up and running, I keep getting Null on the screen