createRedisStorage
function createRedisStorage(options): RedisLinksStorage;Defined in: src/storage/redis.ts:62
Create a Redis-backed RedisLinksStorage. Connection is lazy: the client is created/connected on the first storage operation and reused thereafter.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
RedisStorageOptions |
Returns
Section titled “Returns”Example
Section titled “Example”import { createRedisStorage } from "@xtandard/links/storage/redis";
const storage = createRedisStorage({ url: process.env.REDIS_URL ?? "redis://localhost:6379", prefix: "myapp:links", onError: (err) => console.error("[links/redis]", err),});
// Disconnect when the process exits:// process.on("SIGTERM", () => storage.close());