# @travi/hapi-html-request-router

> hapi plugin to direct html requests to a single route

Latest version **3.0.1** (published 2020-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @travi/hapi-html-request-router
pnpm add @travi/hapi-html-request-router
yarn add @travi/hapi-html-request-router
bun add @travi/hapi-html-request-router
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2020-02-18 |
| First published | 2016-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matt Travi |
| Maintainers | travi |
| Keywords | hapi, html, content-negotiation |

## Links

- npm: https://www.npmjs.com/package/@travi/hapi-html-request-router
- Repository: https://github.com/travi/hapi-html-request-router
- Homepage: https://github.com/travi/hapi-html-request-router#readme
- Issues: https://github.com/travi/hapi-html-request-router/issues
- npm.io page: https://npm.io/package/@travi/hapi-html-request-router

## Dependencies (1)

- [negotiator](https://npm.io/package/negotiator.md) 0.6.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2020-02-18
- 2.0.0-beta.1 (beta) — 2018-06-04
- 3.0.0 — 2019-08-26
- 2.1.0 — 2019-08-26
- 2.0.0 — 2018-06-04
- 2.0.0-beta — 2018-06-04
- 1.2.2 — 2018-06-04
- 1.2.1 — 2018-06-04
- 1.2.0 — 2018-01-10
- 1.1.0 — 2017-01-27
- 1.0.1 — 2017-01-27
- 1.0.0 — 2017-01-25
- 0.2.0 — 2016-12-01
- 0.1.0 — 2016-11-13

## README

# hapi-html-request-router

[hapi](https://hapijs.com) plugin to direct html requests to a single route

[![Build Status](https://img.shields.io/travis/com/travi/hapi-html-request-router.svg?style=flat)](https://travis-ci.com/travi/hapi-html-request-router)

## Usage

[![npm](https://img.shields.io/npm/v/@travi/hapi-html-request-router.svg?maxAge=2592000)](https://www.npmjs.com/package/@travi/hapi-html-request-router)
[![license](https://img.shields.io/github/license/travi/hapi-html-request-router.svg)](LICENSE)

### Installation

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

### Register with your [Hapi](https://hapijs.com) v17 server

Include this plugin in the [manifest](https://github.com/hapijs/glue) of your
hapi application to direct all requests for `text/html` to a
([not included](https://github.com/travi/hapi-react-router)) `/html` route.

```js
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.

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

## Contribution

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Greenkeeper badge](https://badges.greenkeeper.io/travi/hapi-html-request-router.svg)](https://greenkeeper.io/)

### Install dependencies

```sh
$ nvm install
$ npm install
```

### Verification

```sh
$ npm test
```

---
_Source: https://npm.io/package/@travi/hapi-html-request-router · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
