![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
connect-slashes
Advanced tools
Readme
Trailing slash redirect middleware for Connect and Express.js. Useful for creating canonical urls in your Node.js applications.
$ npm install connect-slashes
var connect = require("connect")
, slashes = require("connect-slashes");
connect() // or express()
.use(connect.static())
.use(slashes()) // must come after static middleware!
.listen(3000);
Alternatively, you can pass false
as the first argument to .slashes()
in order to remove trailing slashes instead of appending them:
.use(slashes(false));
You can also pass a second argument with an options object. For example, if an application is behind a reverse proxy server that removes part of the URL (a base_path) before proxying to the application, then the base
can be specified with an option:
.use(slashes(true, { base: "/blog" })); // prepends a base url to the redirect
By default, all redirects are using the 301 Moved Permanently header. You can change this behavior by passing in the optional code
option:
.use(slashes(true, { code: 302 })); // 302 Temporary redirects
You can also set additional headers to the redirect response with the headers
option:
.use(slashes(true, { headers: { "Cache-Control": "public" } }));
.use()
this middleware only after the connect.static()
middleware.MIT
FAQs
Trailing slash redirect middleware for Connect and Express.js
The npm package connect-slashes receives a total of 18,764 weekly downloads. As such, connect-slashes popularity was classified as popular.
We found that connect-slashes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.