Skip to content

Commit

Permalink
Create: POST /todos
Browse files Browse the repository at this point in the history
  • Loading branch information
amejiarosario committed Oct 2, 2014
1 parent 54ab912 commit 28b60c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
8 changes: 8 additions & 0 deletions routes/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ router.get('/', function(req, res, next) {
});
});

/* POST /todos */
router.post('/', function(req, res, next) {
Todo.create(req.body, function (err, post) {
if (err) return next(err);
res.json(post);
});
});

module.exports = router;

0 comments on commit 28b60c4

Please sign in to comment.