no-slash
v1.2.15
Published
express middleware to remove trailing slash
Downloads
19
Readme
no-slash
Express middleware for forcing no trailing url slash via redirect. Defaults to a 301, status code can be passed as an argument.
Usage
- node 6+ recommended, for node < 6, an ES5 module is available at
lib/es5.js
. $ yarn add no-slash
or$ npm install no-slash --save
const express = require('express'),
noSlash = require('no-slash'),
app = express();
app.use(noSlash());
Or for node < 6
var express = require('express'),
noSlash = require('no-slash/lib/es5'),
app = express();
app.use(noSlash());
Contributing
Feel free to fork and submit a PR. Please reference an issue in your PR to simplify tracking them (create one if it doesn't exist, feature or bug).