From 614025073e6e12b762b969d58254d7dced90f70b Mon Sep 17 00:00:00 2001 From: Glen Souza Date: Tue, 18 May 2021 03:39:16 -0700 Subject: [PATCH] Update server.js --- server.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 66f70fa..f27798f 100644 --- a/server.js +++ b/server.js @@ -29,11 +29,15 @@ app.get('/config', function(req, res){ // Allow incrementing or decrementing the step via /up or /down. app.get('/up', function(req, res){ - step++; + if (step < config.task_list_items.length){ + step++; + } res.send('New value: ' + step); }); app.get('/down', function(req, res){ - step--; + if (step > 1){ + step--; + } res.send('New value: ' + step); });