@koex/cache
v0.0.8
Published
cahe hits for koa
Downloads
33
Readme
cache
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');
});