diff --git a/node/query-redis-labs/README.md b/node/query-redis-labs/README.md index 80494283..e31b9bc6 100644 --- a/node/query-redis-labs/README.md +++ b/node/query-redis-labs/README.md @@ -40,6 +40,16 @@ The endpoint to connect to your Redis database. | Required | Yes | | Sample Value | `redis-13258.c35.eu-central-1-1.ec2.redns.redis-cloud.com` | + +### REDIS_PORT + +The port of your Redis database. + +| Question | Answer | +| ------------ | ------- | +| Required | No | +| Sample Value | `13258` | + ### REDIS_PASSWORD Authentication password to access your Redis database. diff --git a/node/query-redis-labs/src/redis.js b/node/query-redis-labs/src/redis.js index 260e3a0d..8332cd35 100644 --- a/node/query-redis-labs/src/redis.js +++ b/node/query-redis-labs/src/redis.js @@ -5,13 +5,13 @@ import { createHash } from 'node:crypto'; * Throws an error if any of the keys are missing from the object */ export async function getClient() { - const { REDIS_PASSWORD, REDIS_HOST } = process.env; + const { REDIS_PASSWORD, REDIS_HOST, REDIS_PORT } = process.env; const client = createClient({ password: REDIS_PASSWORD, socket: { host: REDIS_HOST, - port: 14714 + port: Number(REDIS_PORT ?? 14714) } });