Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

koa-no-trailing-slash

2.1.0 • Public • Published

ComVer

Koa middleware that redirects all requests to an URL with a trailing slash to the same URL without it, ignoring the query string (key and value).

Installation

npm install koa-no-trailing-slash

Usage

const app = new (require('koa'));
app.use(require('koa-no-trailing-slash')());
app.use(async (ctx, next) => {
   ctx.response.body = 'Did this URL had a trailing slash?';
});
app.listen(8000);

License

CC0

Related middleware

koa-lowercase-url

install

npm i koa-no-trailing-slash

Downloadsweekly downloads

185

version

2.1.0

license

CC0-1.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability