diff --git a/server/server.js b/server/server.js index f4b05ab..afa92a8 100644 --- a/server/server.js +++ b/server/server.js @@ -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'); });