Skip to content

Commit

Permalink
Show: GET /todos/:id
Browse files Browse the repository at this point in the history
  • Loading branch information
amejiarosario committed Oct 2, 2014
1 parent 28b60c4 commit 7d8bc67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions routes/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ router.post('/', function(req, res, next) {
});
});

/* GET /todos/id */
router.get('/:id', function(req, res, next) {
Todo.findById(req.params.id, function (err, post) {
if (err) return next(err);
res.json(post);
});
});

module.exports = router;

0 comments on commit 7d8bc67

Please sign in to comment.