diff --git a/routes/storage.js b/routes/storage.js index 897aff0a71ecdf867ba15f0d340d4c268b485a94..99219416a2eda1e360eb175be4ac370474ea497c 100644 --- a/routes/storage.js +++ b/routes/storage.js @@ -29,6 +29,8 @@ router.get('/:resource_id', function(req, res, next) { debug(err); next(err); + db.close(); + }else{ var collection = db.collection('resources'); @@ -55,6 +57,8 @@ router.get('/:resource_id', function(req, res, next) { } + db.close(); + }); } @@ -72,6 +76,8 @@ router.post('/', function(req, res, next){ debug(err); next(err); + db.close(); + }else{ var collection = db.collection('resources'); @@ -104,6 +110,8 @@ router.post('/', function(req, res, next){ debug(error); next(error); + db.close(); + } }