@entva/express-trailingslash
v2.0.0
Published
ExpressJS middleware that redirects requests with trailing slashes to a clean one without it
Maintainers
Readme
@entva/express-trailingslash
ExpressJS 5 middleware that redirects requests with trailing slashes to a clean URL without it.
Usage:
import trailingSlash from '@entva/express-trailingslash';
app.use(trailingSlash());When used together with serve-static, pass redirect: false to avoid conflicts:
import serveStatic from 'serve-static';
app.use(serveStatic(`${__dirname}/public`, { redirect: false }));