From 7ec8eda32a6ea51a8cc24ca24177ee6091332592 Mon Sep 17 00:00:00 2001 From: JD Huntington Date: Mon, 25 Feb 2019 12:11:40 -0800 Subject: [PATCH] [Server] Send HTTP response after processing request. --- server/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index d0b8778..be66b4a 100644 --- a/server/index.js +++ b/server/index.js @@ -40,16 +40,19 @@ app.put('/todos/:id', (req, res) => { app.post('/todos/:id', (req, res) => { store.todos[req.params.id] = req.body; store.save(); + res.json('ok'); }); app.delete('/todos/:id', (req, res) => { delete store.todos[req.params.id]; store.save(); + res.json('ok'); }); -app.post('/todos', req => { +app.post('/todos', (req, res) => { store.todos = req.body; store.save(); + res.json('ok'); }); app.get('/hello', (req, res) => {