koa-check-origin
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Build Status NPM Downloads code style: prettier Gitmoji made-with-typescript

koa-check-origin

A koa middleware that checks if the origin matches the given base URL. If not a HTTP 403 is thrown.

Installation 🏗

koa-check-origin requires Node.js >= v7.6.0 because Koa needs that as well.

$ npm install --save koa-check-origin

or if you use Yarn 🐈

$ yarn add koa-check-origin

Usage 🔨

const createCheckOriginMiddleware = require('koa-check-origin');
 
const app = new Koa();
 
const checkOriginMiddleware = createCheckOriginMiddleware('http://example.com');
app.use(checkOriginMiddleware);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    9
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.1
    9
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i koa-check-origin

Weekly Downloads

9

Version

2.0.1

License

MIT

Unpacked Size

5.3 kB

Total Files

6

Last publish

Collaborators

  • screendriver