0.0.8 • Published 5 years ago

@koex/cache v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

cache

NPM version NPM quality Coverage Status Dependencies Build Status Known Vulnerabilities NPM download license issues

cache for koa extend. And you can custom auto cache db, like redis.

Install

$ npm install @koex/cache

Usage

// See more in test
import cache from '@koex/cache';

import * as Koa from 'koa';
const app = new Koa();
app.use(cache(options));
app.use(async (ctx) => {
  if (ctx.path === '/') {
    ctx.body = 'hello, world';
  } else if (ctx.path === '/json') {
    ctx.body = {
      name: 'name',
      value: 'value',
    };
  }
});

app.listen(8000, '0.0.0.0', () => {
  console.log('koa server start');
});

Related

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.1

5 years ago