express-seo-noslash
v1.0.2
Published
Remove trailing slashes from incoming urls using 301 redirects
Downloads
820
Maintainers
Readme
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