Created
March 2, 2013 00:28
-
-
Save mikermcneil/5069027 to your computer and use it in GitHub Desktop.
async-example-sails.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gameId = 7; | |
async.auto({ | |
game: Game.find(gameId).done, | |
reviews: Review.findAllByGameId(gameId).done | |
}, function (err, results) { | |
var response = { | |
id: results.game.id, | |
name: results.game.name, | |
reviews: results.reviews | |
}; | |
res.json(response); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cannot run this code in sails 0.10 rc9