Skip to content

Instantly share code, notes, and snippets.

@joepie91
Last active December 17, 2015 17:08
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 joepie91/f3ff7b1ea463b5bd1910 to your computer and use it in GitHub Desktop.
Save joepie91/f3ff7b1ea463b5bd1910 to your computer and use it in GitHub Desktop.
AuctionController.getAll = function() {
return collections.AuctionCollection.forge().fetch();
};
router.get('/', function(request, response, next) {
Promise.try(function() {
return AuctionController.getAll();
}).then(function(data) {
//response.send(data);
res.render('list-auctions');
}).catch(function(err) {
response.status(500).send({error: err});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment