and what is the equivalent for a pure node implementation? I was considering dropping Express and just using Node for my server. What would be the equivalent representation of the code below in Node?
// https://www.npmjs.com/package/connect-redis
const session = require("express-session");
const RedisStore = require("connect-redis")(session);
const { createClient } = require("redis");
const client = createClient({ legacyMode: true });
client.connect().catch(console.error);
client.on('connect' , () => console.log('DEBUG: redis: connect'));
client.on('ready' , () => console.log('DEBUG: redis: ready'));
client.on('reconnecting', () => console.log('DEBUG: redis: reconnecting'));
client.on('error' , () => console.log('DEBUG: redis: error'));
client.on('end' , () => console.log('DEBUG: redis: end'));
app.use(
session({
store: new RedisStore({ client: client }),
saveUninitialized: false,
secret: "keyboard cat",
resave: false,
})
)
}