Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.
/ koa-no-trailing-slash Public archive

Middleware that redirects all requests to an URL with a trailing slash to the same URL without it

Notifications You must be signed in to change notification settings

tssm/koa-no-trailing-slash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Middleware that redirects all requests to an URL with a trailing slash to the same URL without it

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published