From 408c933fce598fbe71b032b72712262ef3751708 Mon Sep 17 00:00:00 2001 From: Michelle <mi00354@surrey.ac.uk> Date: Mon, 24 May 2021 14:40:57 +0100 Subject: [PATCH] remove closing db --- NodeAPI/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/NodeAPI/index.js b/NodeAPI/index.js index 7c861f8..12bc142 100644 --- a/NodeAPI/index.js +++ b/NodeAPI/index.js @@ -52,8 +52,6 @@ app.post('/predict', (req,res) => { // Insert the record to the collection, throw error if insert unsuccessful collection.insert(rec, {w:1}, function(err, result) {}); - }, function(){ - db.close(); }); res.render('predictions',{predictions:JSON.parse(JSON.parse(body).predictionText)}) @@ -74,7 +72,6 @@ app.get('/submissions', function (req, res) { cursor.forEach(function(doc, err){ resultArray.push(doc) }, function(){ - db.close(); res.render('submissions', {items: resultArray}); }); }); -- GitLab