catbox-redis

Redis adapter for catbox.

Latest Version: 6.0.0
hapi-family
Installation:

npm: npm install @hapi/catbox-redis

yarn: yarn add @hapi/catbox-redis

Module Status:
Version License Node Dependencies Travis End of Life
6.0.0
hapi helmet github logo
BSD 12 Dependency Status Build Status

Usage

Sample catbox cache initialization:

const Catbox = require('@hapi/catbox');
const CatboxRedis = require('@hapi/catbox-redis');


const cache = new Catbox.Client(CatboxRedis, {
    partition : 'my_cached_data'
    host: 'redis-cluster.domain.com',
    port: 6379,
    db: 0,
    tls: {},
});

When used in a hapi server (hapi version 18 or newer):

const Hapi = require('hapi')
const CatboxRedis = require('@hapi/catbox-redis');

const server = new Hapi.Server({
    cache : [
        {
            name: 'my_cache',
            provider: {
                constructor: CatboxRedis,
                options: {
                    partition : 'my_cached_data'
                    host: 'redis-cluster.domain.com',
                    port: 6379,
                    db: 0,
                    tls: {},
                }
            }
        }
    ]
});