koa-xframe
v0.2.0
Published
X-Frame-Options HTTP response header utility for Koa
Downloads
8
Readme
Koa XFrame
X-Frame-Options HTTP response header utility for Koa.
Installation
$ npm install --save koa-xframe
Usage & API
import Koa from 'koa';
import xFrame from 'koa-xframe';
const app = new Koa();
// default settings -> set X-Frame-Options to 'DENY'
app.use(xFrame());
// custom settings
// -> set X-Frame-Options to 'DENY'
app.use(xFrame('DENY'));
// -> set X-Frame-Options to 'SAMEORIGIN'
app.use(xFrame('SAMEORIGIN'));
Credits
Inspired by Koala headers.js middleware.