Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

tssm/koa-lowercase-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koa middleware that redirects all requests to an URL with uppercase letters to the same URL in lowercase, ignoring the query string (key and value).

Installation

npm install koa-lowercase-url

Usage

const app = new (require('koa'));
app.use(require('koa-to-lowercase')());
app.use(async (ctx, next) => {
   ctx.response.body = 'If this URL had uppercase letters before the ? now they are in lowercase.';
});
app.listen(8000);

License

CC0

Related middleware

koa-no-trailing-slash

About

Middleware that redirects all requests to an URL with uppercase letters to the same URL in lowercase

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published