mjlescano / koa-polyfill-service

Koa middleware for https://github.com/Financial-Times/polyfill-service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Koa Polyfill service

Polyfill service middleware for koa.

Usage

npm install koa-polyfill-service --save
const polyfill = require('koa-polyfill-service')
app.use(polyfill())

API

app.use(polyfill([options]))

The options for the middleware, other than those passed directly to getPolyfillString, are:

  • maxAge - the max age for the polyfill's cache control, defaulting to 2 weeks
  • path - route to serve lib, defaulting to /polyfill.js
  • features - the same as getPolyfillString option, but defaulting to {default: {}}.

Disclaimer: 🙈 shameless copy of koa Polyfills, but using Polyfill service.

About

Koa middleware for https://github.com/Financial-Times/polyfill-service

License:MIT License


Languages

Language:JavaScript 100.0%