Skip to content

Instantly share code, notes, and snippets.

@chanakaDe
Created October 19, 2015 16:43
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 chanakaDe/743f8bc610838784583a to your computer and use it in GitHub Desktop.
Save chanakaDe/743f8bc610838784583a to your computer and use it in GitHub Desktop.
/**
* Get all users from the database.
*/
api.get('/users', function (req, res) {
User.find({}, function (err, users) {
if (err) {
res.send(err);
return;
}
res.json(users);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment