initRedis
function initRedis(config: Object)
Initializes a Redis client using the redis
package.
Returns: Object
- Redis client instance.
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
config | Object | Redis configuration options. See the official redis package documentation for more details: | ||
config.url | string | Redis connection URL. |
Throws:
Will log an error and exit the process if the Redis URL is missing or the connection fails.
See:
const redisClient = initRedis({ url: "redis://localhost:6379" });