Socket
Book a DemoInstallSign in
Socket

express-seo-noslash

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-seo-noslash

Remove trailing slashes from incoming urls using 301 redirects

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
80
-32.77%
Maintainers
1
Weekly downloads
 
Created
Source

express-seo-noslash

Express middleware to remove trailing slashes from incoming urls using 301 redirects.

Install

npm install --save express-seo-noslash

Usage

Add middleware to your express application before all other routes.

var express = require('express');
var app = express();
var removeTrailingSlash = require('express-seo-noslash');

// add middleware
app.use(removeTrailingSlash);

// standard route
app.get('/my-page', function(req, res) {
    res.send('Hello world!');
});

Incoming requests to /my-page/ will be 301 redirected to /my-page

Contributing

Feel free to contribute, either by raising an issue or:

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -m 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

History

For change-log, check releases.

License

Licensed under MIT License © John Doherty

Keywords

express

FAQs

Package last updated on 27 Dec 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.