express-lowercase-paths-with-status-code

1.1.0 • Public • Published

Very similar to the unmaintained project express-uncapitalize, this middleware redirects any requests which contain uppercase chars to their lowercase forms. With two main changes from the original:

  1. Works with all utf-8 strings in paths
  2. Keeps query parameters intact

Installation

npm install express-lowercase-paths

Usage

var lowercasePaths = require("express-lowercase-paths")
app.use(lowercasePaths())

Options

Redirecting with specific status code

To redirect with a specific status code, pass the redirectStatusCode option to the middleware:

var lowercasePaths = require("express-lowercase-paths")
app.use(lowercasePaths({redirectStatusCode: 301}))

Package Sidebar

Install

npm i express-lowercase-paths-with-status-code

Weekly Downloads

111

Version

1.1.0

License

MIT

Unpacked Size

1.87 kB

Total Files

3

Last publish

Collaborators

  • bkrem