npm.io
2.1.0 • Published 8 years ago

koa-no-trailing-slash

Licence
CC0-1.0
Version
2.1.0
Deps
0
Vulns
0
Weekly
0

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

koa-lowercase-url

Keywords