Express Slash Middleware

JSON →
library 2.0.1 ·javascript abandoned
verified May 27, 2026

express-slash is an Express.js middleware designed for web applications that enforce strict routing rules regarding trailing slashes in URLs. It automatically handles `GET` and `HEAD` requests, redirecting clients (with a 301 status code by default) to the canonical URL with or without a trailing slash, based on the application's configured routes and `strict routing` setting. This package ensures URL consistency and prevents 404 errors for users who might incorrectly add or omit trailing slashes. The current stable version is 2.0.1, specifically compatible with Express 4.x. Version 1.x was for Express 3.x. The package has not seen active development in many years, suggesting it is in an abandoned state. While alternatives exist, its direct integration with Express's `strict routing` is a key differentiator for maintaining consistent URL structures programmatically.

total hits 22
actors 8 distinct systems
last hit 1d ago AhrefsBot
ChatGPT-User
4
MetaBot
4
GPTBot
2
PerplexityBot
2
Script
1
Search engines
2
Humans
4

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · TH