Skip to content

Commit 7d8bc67

Browse files
committed
Show: GET /todos/:id
1 parent 28b60c4 commit 7d8bc67

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

routes/todos.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,12 @@ router.post('/', function(req, res, next) {
2020
});
2121
});
2222

23+
/* GET /todos/id */
24+
router.get('/:id', function(req, res, next) {
25+
Todo.findById(req.params.id, function (err, post) {
26+
if (err) return next(err);
27+
res.json(post);
28+
});
29+
});
30+
2331
module.exports = router;

0 commit comments

Comments
 (0)