express-seo-noslash

1.0.2 • Public • Published

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:

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

History

For change-log, check releases.

License

Licensed under MIT License © John Doherty

Package Sidebar

Install

npm i express-seo-noslash

Weekly Downloads

157

Version

1.0.2

License

MIT

Unpacked Size

3.76 kB

Total Files

5

Last publish

Collaborators

  • john-doherty