Skip to content

koexjs/redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis

NPM version Coverage Status Dependencies Build Status license issues

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');
});

Related