'I'm trying to connect to redis.com but I'm unable to
I created a redis database at redis.com, but I'm unable to connect to it to store my sessions in nodejs.
Here's what I did:
var redisClient = redis.createClient('redis://<db-name>:<host>:<port>');
app.use (
session ({
store: redisClient ? new RedisStore({
client: redisClient
}) : null,
secret: "x",
resave: false,
saveUninitialized: true,
// proxy: true,
// rolling: true,
cookie: {
expires: new Date(Date.now() + (30*24*3600000)),
secure: true
}
})
);
I get the error Error: The client is closed
`Does anyone know why?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
