Created
July 8, 2017 09:31
-
-
Save Amberlamps/4d9ff98c9263d72333ff10a8a109fe61 to your computer and use it in GitHub Desktop.
going full circle 2
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
app.get('/users/:userId', (req, res) => { | |
db.getUserAsync(req.params.userId, (err, user) => { | |
db.getPostsByUserAsync(user.id, (err, posts) => { | |
db.getCommentsByPostsAsync(posts, (err, comments) => { | |
res.json(mergeData(user, posts, comments)); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment