From ee9ed42f96be4d251cb971466dbca54898f3838b Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Wed, 29 Nov 2017 23:32:28 -0500 Subject: [PATCH] todos --- server/server.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/server.js b/server/server.js index 7130e5e..8c7d4bf 100644 --- a/server/server.js +++ b/server/server.js @@ -21,6 +21,15 @@ app.post('/todos', (req, res) => { }); }); +app.get('/todos', (req, res) => { + var todos = Todo.find().then((todos) => { + return res.send({todos}); + }, (e) => { + return res.status(400).send(e); + }); +}); + + app.listen(8888, () => { console.log("Started on port 8888"); });