diff options
| author | kumar dam <kumar.damani@mail.utoronto.ca> | 2017-04-30 01:38:53 +0000 |
|---|---|---|
| committer | kumar dam <kumar.damani@mail.utoronto.ca> | 2017-04-30 01:38:53 +0000 |
| commit | fb06a6490e1abcb56d2ca11a7e1ad812dceb943f (patch) | |
| tree | 9eed1c89a5c4b7e568e52a1473e24d0d520a672d /app | |
| parent | d52437a4f88af931f130c7bb259949a84db65276 (diff) | |
fixed all indents
Diffstat (limited to 'app')
| -rw-r--r-- | app/routes.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/routes.js b/app/routes.js index 7b596dc..724af11 100644 --- a/app/routes.js +++ b/app/routes.js @@ -1,18 +1,15 @@ // get the todos collection var todoCollect = require('./models/todo'); - // use mongo to get all the items in db function getTodos (res) { todoCollect.find(function (err, todos) { if (err) res.send(err); - - res.json(todos); // return all todos in JSON format - // console.log(todos); + // return all todos in JSON format + res.json(todos); }); } - // ===========================API=============================== module.exports = function (app) { @@ -30,7 +27,6 @@ module.exports = function (app) { done: false }, function (err, todo) { if (err) res.send(err); - // 'refresh' to-do list getTodos(res); }); @@ -43,7 +39,6 @@ module.exports = function (app) { _id: req.params.todo_id }, function (err, todo) { if (err) res.send(err); - // 'refresh' to-do list getTodos(res); }); @@ -53,4 +48,4 @@ module.exports = function (app) { app.get('*', function (req, res) { res.sendFile(__dirname + '/public/index.html'); }); -};
\ No newline at end of file +}; |
