jeudi 26 mars 2015

How to register a user using the _user table in CouchDb?

Description:


I am attempting to register a user. My strategy is to add the user into the _user database of CouchDb. I already have session functionality to a user that I manually put in that db.


I am using Nano for my Node/CouchDb interactions.


What I have tried:


I have used the structure explained in this question



var userDb = nano.use('_users');

userDb.insert(req.body.data, function(err, body) {
if(err) console.log(err);

res.json(body);
res.end();
});


Problem:


Everytime I attempt to add a user to the db and get this error from node.js:



[ Error: error happened in your connection ]



I am assuming this is timing out because the _user db is authenticated or something. Do I use a different db for users that are not admin?


Aucun commentaire:

Enregistrer un commentaire