From 5c0348e858414d1d6d31b15f552caf167df62455 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Fri, 27 Jul 2018 23:39:04 -0700 Subject: [PATCH] userId fix attempt 5 --- app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 9f1e728..3b97bef 100644 --- a/app.js +++ b/app.js @@ -44,10 +44,12 @@ handleDisconnect(); app.get('/userid', function (req, res) { con.query('SELECT max(userId) from messages;', function (err, result, fields) { if (err) throw err; - if (result) + if (result) { + console.log(result); res.json({userId: result + 1}); - else + } else { res.json({userId: 1}); + } }); });