diff --git a/NodeAPI/index.js b/NodeAPI/index.js index 7c861f843072907422a60807be040499d7d4e4a2..12bc142b132d9bf3b1fbc5db76696680ccce1633 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}); }); });