From 2b3f3f0c2ee22e5100c5e1a5adcd14f75608adba Mon Sep 17 00:00:00 2001 From: andreagerino Date: Fri, 27 Nov 2015 18:47:36 +0100 Subject: [PATCH] ... --- routes/storage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/storage.js b/routes/storage.js index 0da21d2..139d81f 100644 --- a/routes/storage.js +++ b/routes/storage.js @@ -6,7 +6,7 @@ var mongoClient = require('mongodb').MongoClient; var assert = assert = require('assert'); // Connection URL -var mongoUrl = 'mongodb://icarus:icarus@webdev.ewlab.di.unimi.it:27017/icarus'; +var mongoUrl = 'mongodb://icarus:icarus@localhost:27017/icarus'; //Use connect method to test the connection to the Server mongoClient.connect(mongoUrl, function(err, db) { @@ -38,7 +38,7 @@ router.post('/', function(req, res, next){ var collection = db.collection('resources'); var resource = req.body; - if(Object.keys(resource)>0) { + if(Object.keys(resource).length>0) { collection.insertOne(resource, function (err, r) { -- 2.18.1