Koa middleware that normalizes paths.
Notice: koa-normalize-path@2 supports koa@2; if you want to use this module with koa@1, please use koa-normalize-path@1.
npm install koa-normalize-path
const Koa = ;const app = ;app;
defer- If true, serves after yield next, allowing any downstream middleware to respond first. Defaults to
chained- If the middleware should continue modifying the url if it detects that a redirect already have been performed. Defaults to
const Koa = ;const normalizePath = ;const app = ;app;app;app;
When used together with koa-static it might be a good idea to set
koa-static and false for
koa-normalize-path. This to avoid a potential problem that will result in an error being thrown stating the path is malicious if it starts with multiple slashes. https://github.com/koajs/send/issues/51