Brianzchen / koa-unmatch

Run other koa middleware given that the path DOES NOT match

Home Page:https://www.npmjs.com/package/koa-unmatch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

koa-unmatch

Run other koa middleware given that the path DOES NOT match

Passing in either a single or array of strings, plus a middleware, this middleware will run the given middleware when the requested path does not match any of the given paths

Installation

This module is distributed via npm:

npm install --save koa-unmatch

or

yarn add koa-unmatch

Usage

const Koa = require('koa');
const unmatch = require('koa-unmatch');

const app = new Koa();
app.use(unmatch('/path', (ctx, next) => {
  // do something here
}))

About

Run other koa middleware given that the path DOES NOT match

https://www.npmjs.com/package/koa-unmatch

License:MIT License


Languages

Language:JavaScript 100.0%