slashify
Express/Connect middleware to handle trailing slashes with options
Last updated 12 years ago by scottcorgan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install slashify 
SYNC missed versions from official npm registry.

slashify

Express/Connect middleware to handle trailing slashes with options.

Why?

Why another remove trailing slash middleware? Because we wanted options. Like leaving the slash when serving the index file of a directory and custom index file names, etc!

Install

npm install slashify --save

Usage

var express = require('express');
var slashify = require('slashify');

var app = express();

app.use(slashify());

app.listen(3000, function () {
  
});

slashify([options])

  • options
    • root - the root directory. This is mostly used when you have a directory handling turned on and/or have custom index file names. Defaults to ./
    • index - the name of the directory index file. Defaults to index.html.
    • directory - set whether or not you want slashify to leave the trailing slash when serving the index file of a directory. Defaults to true. Set to false to remove the trailing slash for all paths.

Run Tests

npm install
npm test

Current Tags

  • 1.0.0                                ...           latest (12 years ago)

2 Versions

  • 1.0.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 6
Today 0
This Week 2
This Month 6
Last Day 0
Last Week 4
Last Month 0
Dependencies (2)
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE