think-ioredis
Use ioredis for thinkjs session,cache Wo had test using for session and cache
Features
- defined prefix for session.
Install
npm install think-ioredis
How to use
- import Adapter
thinkthinkthink
- defined config: common/config/ioredis.js
'use strict' /** * redis configs * more than one nodes,wo will connection with Redis Cluster */ nodes: host: 'localhost' port: 6379 // { // host: '10.21.10.101', // port: 6370 // } password: '' // ... other config
- Cache config
type: 'ioredis' // config ioredis type timeout: 3600 adapter: ioredis: prefix: 'mydmpweb:cache:'
- Session config
'use strict' /** * session configs */ name: 'thinkjs_' type: 'ioredis' secret: '6T3fdfert34&3e3dedtrre#' timeout: 3600 cookie: // cookie options length: 32 httponly: true adapter: ioredis: prefix: 'mydmpweb:session:'
Usage is the same as official adapter
LICENSE
MIT