diff --git a/node/query-redis-labs/README.md b/node/query-redis-labs/README.md index 80494283..f2eea549 100644 --- a/node/query-redis-labs/README.md +++ b/node/query-redis-labs/README.md @@ -48,3 +48,12 @@ Authentication password to access your Redis database. | ------------ | ------------------------------ | | Required | Yes | | Sample Value | `efNNehiACfcZiwsTAjcK6xiwPyu6Dpdq` | + +### REDIS_PORT + +The port on which your Redis database is listening. + +| Question | Answer | +| ------------ | ------------------------------ | +| Required | No (Defaults to `14714`) | +| Sample Value | `14714` | diff --git a/node/query-redis-labs/src/redis.js b/node/query-redis-labs/src/redis.js index 260e3a0d..1a212c11 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: REDIS_PORT ? parseInt(REDIS_PORT, 10) : 14714 } });