koa-remove-trailing-slashes
Koa middleware that removes trailing slashes on paths.
Notice: koa-remove-trailing-slashes@2 supports koa@2; if you want to use this module with koa@1, please use koa-remove-trailing-slashes@1.
Installation
npm install koa-remove-trailing-slashes
API
const Koa = ;const app = ;app;
opts
options object.
Options
defer
- If true, serves after yield next, allowing any downstream middleware to respond first. Defaults totrue
.chained
- If the middleware should continue modifying the url if it detects that a redirect already have been performed. Defaults totrue
.
Example
const Koa = ;const removeTrailingSlashes = ; const app = ; app; app; app;
License
MIT