Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 660 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 660 Bytes

Koache

js-standard-style

Koache is small middleware using node-cache to cache requests. Koache will cache each path of your application, so you can use it in combination of koa-router

const Koa = require("koa");
const cache = require("koache");

const app = new Koa();

// See node-cache documentation to see allowded options
app.use(cache({ stdTTL: 10 }));

app.use(async ctx => {
  ctx.body = "smaug";
});

app.listen(3001, () => console.log("listening..."));