Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function (req, res, next) {
- if (req.path !== '/login') {
- const route = req.path
- const ip = req.ip
- const userId = req.userId
- const timestamp = new Date()
- client.hmset('HashKey', {
- 'route': route,
- 'ipAddress': ip,
- 'userId': userId,
- 'timestamp': timestamp
- })
- }
- console.log(client.hgetall('Hashkey') + ' || Hashkey')
- client.hgetall('Hashkey', function (err, results) {
- if (err) {
- return err
- } else {
- console.log(results + ' || Parsed Hashkey')
- }
- })
- next()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement