1.0.3 • Published 6 years ago

koa-next-middleware v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

koa-next-middleware

npm npm

Overview

Koa Next Middleware

Install

npm install koa-next-middleware

or

yarn add koa-next-middleware

Usage

const Koa = require('koa');
const Next = require('Next');
const LRUCache = require('lru-cache);
const NextMiddleware = require('koa-next-middleware');

const app = new Koa();
const isDev = process.env.NODE_ENV !== 'production';
const ssrCache = new LRUCache({
  max: 100,
  maxAge: 1000 * 60 * 60 // 1hour
});
const appnext = Next({
  dev: isDev
});

app.use(NextMiddleware(appnext, {
  cache: isDev ? null : ssrCache
}));

app.listen(3000);

LICENSE

MIT@PLDaily

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago