koa-xframe

0.2.0 • Public • Published

Koa XFrame

NPM version build status Test coverage David deps npm download

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.

License

MIT

/koa-xframe/

    Package Sidebar

    Install

    npm i koa-xframe

    Weekly Downloads

    11

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • broucz