Skip to content

Instantly share code, notes, and snippets.

@tj

tj/tj

Forked from randallb/gist:1100361
Created July 22, 2011 20:32
Show Gist options
  • Save tj/1100363 to your computer and use it in GitHub Desktop.
Save tj/1100363 to your computer and use it in GitHub Desktop.
exports.register = function(req, res, next) {
var client;
client = this.client;
return exports.validate(req, res, function() {
return client.hmset("person:" + req.body.wid, req.body, function(err, response) {
if (err != null) {
return next(err);
} else {
req.newUser = req.body;
console.log("success. Saved record.");
return next;
}
});
});
};
exports.register = function(req, res, next) {
...
exports.validate(req, res, function(){
client.hmset..(function(err){
if (err) {
next(err);
} else {
req.newUser = ...
next();
}
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment