Skip to content

Instantly share code, notes, and snippets.

@cpjk
Last active July 15, 2017 18:34
Show Gist options
  • Save cpjk/20cbb79d0cba0e33c49f5ae6fdf76dfb to your computer and use it in GitHub Desktop.
Save cpjk/20cbb79d0cba0e33c49f5ae6fdf76dfb to your computer and use it in GitHub Desktop.
app.use(function(req, res, next) {
Choral.createNew({
user: res.locals.userModel,
type: 'device',
name: 'asdf'
}, (err, choral) => { // HERE IS THE CALLBACK WE PASS
if (err) {
console.log(err);
return next(err);
}
// DO THINGS WITH YOUR NEW CHORAL
});
return next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment