hapi-trailing-slash

handles trailing slash issues in hapi

Usage no npm install needed!

<script type="module">
  import hapiTrailingSlash from 'https://cdn.skypack.dev/hapi-trailing-slash';
</script>

README

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