I am working on a 'sign up' page and having trouble with sqlite.
I am using express, bcrypt-nodejs, bookself.js for sqlite. getting an error saying database is lock. any workaround for this? appreciated. below is the code for the part.
var username = req.body.username;
var password = req.body.password;
bcrypt.hash(password, null, null, function(err, hash){
new User({'username': username, 'password': hash})
.save()
.then(function(){
console.log('Succesfully saved the user');
})
.catch(function(err){
throw err;
});
});
Aucun commentaire:
Enregistrer un commentaire