Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mfinelli/koa-uncapitalize
koajs middleware to uncapitalize routes
https://github.com/mfinelli/koa-uncapitalize
koajs nodejs
Last synced: 3 months ago
JSON representation
koajs middleware to uncapitalize routes
- Host: GitHub
- URL: https://github.com/mfinelli/koa-uncapitalize
- Owner: mfinelli
- License: mit
- Created: 2016-04-30T11:14:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T23:28:32.000Z (4 months ago)
- Last Synced: 2024-09-27T21:41:03.481Z (3 months ago)
- Topics: koajs, nodejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/koa-uncapitalize
- Size: 264 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Koa Uncapitalize
[![NPM](https://img.shields.io/npm/v/koa-uncapitalize.svg)](https://www.npmjs.com/package/koa-uncapitalize)
![Build Status](https://github.com/mfinelli/koa-uncapitalize/workflows/CI/badge.svg)A [koajs](https://github.com/koajs/koa) middleware to uncapitalize routes
based on a similar module that was created for express:
[express-uncapitalize](https://github.com/jamiesteven/express-uncapitalize).## Installation
Install the package using [npm](https://www.npmjs.com/):
```shell
$ npm install --save koa-uncapitalize
```## Usage
Usage is easy: just require the module and `app.use` it:
```javascript
const uncapitalize = require("koa-uncapitalize");
app.use(uncapitalize);
```Or all at once:
```javascript
app.use(require("koa-uncapitalize"));
```Now all users accessing uppercase routes will be redirected (301) to the
lowercase equivalent: `http://example.com/TEST` -> `http://example.com/test`.## License
Licensed under the [MIT license](https://opensource.org/licenses/MIT). For
more information please see the LICENSE file that should have been included
with the project.