samedi 28 février 2015

node mongoose connection error

data gets submitted to the database, but instead of listing the new data everything just shuts down with net::ERR_CONNECTION_REFUSED



app.post('/api/todos', function(req, res) {
todo.create({
text : req.body.text,
done : true
}, function(err, todo) {
if (err) res.send(err);
todo.find(function(err, todos){
if(err)
res.send(err)
res.json(todos);
});
});
});


Data gets submitted to db, so that confuses me even more.


Aucun commentaire:

Enregistrer un commentaire