Skip to content

Commit

Permalink
Adds GET /todos route
Browse files Browse the repository at this point in the history
  • Loading branch information
DeadlockDruid committed Sep 24, 2018
1 parent 8b22a0d commit 349c45a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ app.post('/todos', (req, res) => {
});
});

app.get('/todos', (req, res) => {
Todo.find().then((todos) => {
res.send({todos});
}, (e) => res.status(400).send(e));
});

app.listen(3000, () => {
console.log('Started on port: 3000');
});
Expand Down

0 comments on commit 349c45a

Please sign in to comment.