Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. module.exports = function (req, res, next) {
  2. if (req.path !== '/login') {
  3. const route = req.path
  4. const ip = req.ip
  5. const userId = req.userId
  6. const timestamp = new Date()
  7. client.hmset('HashKey', {
  8. 'route': route,
  9. 'ipAddress': ip,
  10. 'userId': userId,
  11. 'timestamp': timestamp
  12. })
  13. }
  14.  
  15. console.log(client.hgetall('Hashkey') + ' || Hashkey')
  16.  
  17. client.hgetall('Hashkey', function (err, results) {
  18.  
  19. if (err) {
  20. return err
  21. } else {
  22. console.log(results + ' || Parsed Hashkey')
  23. }
  24. })
  25. next()
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement