Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Created June 12, 2014 22:27
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 clouddueling/36b34082ac470a8d497b to your computer and use it in GitHub Desktop.
Save clouddueling/36b34082ac470a8d497b to your computer and use it in GitHub Desktop.
Any suggestions on how to extract the database stuff. Is this fine since it's just an adapter?
module.exports = {
find: function (req, res) {
return User.findOne(req.param('id'))
.exec(function(err, user) {
return res.json({
user: user
});
});
},
index: function (req, res) {
return User.find()
.exec(function(err, users) {
return res.json({
users: users
});
});
},
_config: {
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment