@koex/redis
v0.0.2
Published
redis for koa extend
Downloads
5
Readme
redis
redis for koa extend, based on ioredis.
Install
$ npm install @koex/redis
Usage
// See more in test
import redis from '@koex/redis';
import * as Koa from 'koa';
const app = new Koa();
app.use(redis());
app.use(redis({
port: 6379, // Redis port
host: '127.0.0.1', // Redis host
family: 4, // 4 (IPv4) or 6 (IPv6)
password: 'auth',
db: 0
}));
app.use(ctx => {
ctx.body = 'Hello, World!';
});
app.listen(8000, '0.0.0.0', () => {
console.log('koa server start at port: 8000');
});