npm.io
3.1.1 • Published 5 years ago

hapi-trailing-slash

Licence
MIT
Version
3.1.1
Deps
2
Size
15 kB
Vulns
1
Weekly
0
Stars
2

hapi-trailing-slash # Build Status

Handles common trailing slash issues for incoming URLs

###register like so:###

var module = require("hapi-trailing-slash");
.
.
.
server.register({
  register: module,
  options: {
    method: 'remove',
    verbose: true
  }
});

###options are:###

  • 'append' -- detects incoming requests that have no trailing slash, adds one, and redirects to the new url
  • 'remove' -- detects incoming requests with a trailing slash, removes it, and redirects to the new url