Created
August 20, 2017 15:14
-
-
Save conanak99/6524e82f1f11a0dce22b21d662307e1f to your computer and use it in GitHub Desktop.
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('/log', function(request, response) { | |
// Tìm những log trong database có userId trùng với id trong cookie | |
// Sắp xếp theo thứ tự thời gian | |
db.log.find({ userId: request.cookies.id }).sort( {time: -1} , (err, docs) => { | |
response.json({ id: userId, logs: docs }); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment