Skip to content

Instantly share code, notes, and snippets.

@dantenovski
Last active February 22, 2018 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dantenovski/fc337060d74d05cfad44084b3e9c143c to your computer and use it in GitHub Desktop.
Save dantenovski/fc337060d74d05cfad44084b3e9c143c to your computer and use it in GitHub Desktop.
busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated, encoding, mimetype) {
console.log('Field [' + fieldname + ']: value: ' + inspect(val));
Account.register(new Account({ nickname: req.body.username, email: req.body.email }), req.body.passwordOne, (err, user) => {
if(err){
helpers.errors(err, res);
} else {
helpers.registerSuccess(res);
}
});
});
busboy.on('finish', function() {
console.log('Done parsing form!');
//res.writeHead(303, { Connection: 'close', Location: '/' });
res.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment