Skip to content

alexey-detr/auzy-storage-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auzy redis storage

Redis storage package for auzy based on ioredis

Installation and configuration

To use redis as a storage with auzy you have to install it into your project:

yarn add auzy-storage-redis
npm i --save auzy-storage-redis

In most cases you can just set auzy environment hint without ioredis configuration.

const express = require('express');
const auzy = require('../index');

const auzyConfig = {
    session: {
        // session handler configuration here
    },
};
const auzyEnvironment = {
    framework: 'express',
    storage: 'redis',
};

const server = express();
server.use(auzy(auzyConfig, auzyEnvironment));
server.listen(8080);

Advanced usage example

In case if you have unusual Redis connection settings you can specify them in the auzy storage configuration. Storage config is an ioredis config object.

const express = require('express');
const auzy = require('../index');

const auzyConfig = {
    session: {
        // session handler configuration here
    },
    storage: {
        port: 6379,          // Redis port
        host: '127.0.0.1',   // Redis host
        family: 4,           // 4 (IPv4) or 6 (IPv6)
        password: 'auth',
        db: 0,
    },
};
const auzyEnvironment = {
    framework: 'express',
    storage: 'redis',
};

const server = express();
server.use(auzy(auzyConfig, auzyEnvironment));
server.listen(8080);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published