0.4.0 • Published 9 years ago

notrailing v0.4.0

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

notrailing

A super simple module to delete trailing slashes

// Include the repository from npm
var notrailing = require('notrailing')();

// Allow express to use it
app.use(notrailing);

Your urls will remove their trailing slashes. The only exception is the root one /, since deleting it makes a nasty redirect loop.

Options

The following options can be passed to the function:

  • slash (experimental, defaults false): says whether or not to force trailing. Defaults to delete all of the trailing slashes, but you can keep them all. Testing needed to make sure that there are no strange redirects when this is set to true and we are accessing files or other extensions

  • permanent (defaults to true): perform a permanent redirect (301). Set it to false to perform a temporary redirect (307)

var notrailing = require('notrailing')({ slash: false, permanent: true });
0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago