1.0.3 • Published 5 years ago

koa-next-middleware v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 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

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago