3.0.1 • Published 4 years ago

@travi/hapi-html-request-router v3.0.1

Weekly downloads
223
License
MIT
Repository
github
Last release
4 years ago

hapi-html-request-router

hapi plugin to direct html requests to a single route

Build Status

Usage

npm license

Installation

$ npm install @travi/hapi-html-request-router

Register with your Hapi v17 server

Include this plugin in the manifest of your hapi application to direct all requests for text/html to a (not included) /html route.

export default {
    server: {port: process.env.PORT},
    register: {
      plugins: [
        {plugin: '@travi/hapi-html-request-router'}
      ]
    }
}

Options

excludedRoutes

Sometimes you don't want all routes to be re-routed to the /html route. Provide a list of routes as strings or regex patterns to exclude them from being re-routed.

export default {
    server: {port: process.env.PORT},
    register: {
      plugins: [
        {
          plugin: '@travi/hapi-html-request-router',
          options: [
            '/login',
            '/logout',
            '/foo/*',
            /\/bar\/.*/
          ]
        }
      ]
    }
}

Contribution

Commitizen friendly semantic-release Greenkeeper badge

Install dependencies

$ nvm install
$ npm install

Verification

$ npm test
3.0.1

4 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.0

6 years ago

2.0.0-beta.1

6 years ago

2.0.0-beta

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.2.0

7 years ago

0.1.0

8 years ago