Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions node/query-redis-labs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
4 changes: 2 additions & 2 deletions node/query-redis-labs/src/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
});

Expand Down