Skip to content

Instantly share code, notes, and snippets.

@deepaksinghvi
Created March 28, 2012 17:32
Show Gist options
  • Save deepaksinghvi/2228479 to your computer and use it in GitHub Desktop.
Save deepaksinghvi/2228479 to your computer and use it in GitHub Desktop.
Create a new user
// Create user
app.post('/newuser', function(req, res) {
var d = new TestUser(req.body.d);
d.save(function() {
TestUser.find({}, function(err, user) {
user = user.map(function(u) {
return { username: u.username, password: u.password };
});
res.render('user/index.jade', {
locals: { d: user }
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment