11# hapi-react-router
22
3- hapi route to delegate routing for html content to react-router
3+ [ hapi] ( https://hapijs.com ) route to delegate routing for html content to react-router
44
5- [ ![ npm] ( https://img.shields.io/npm/v/@travi/hapi-react-router.svg?maxAge=2592000 )] ( https://www.npmjs.com/package/@travi/hapi-react-router )
6- [ ![ license] ( https://img.shields.io/github/license/travi/hapi-react-router.svg )] ( LICENSE )
75[ ![ Build Status] ( https://img.shields.io/travis/travi/hapi-react-router.svg?style=flat&branch=master )] ( https://travis-ci.org/travi/hapi-react-router )
86[ ![ Codecov] ( https://img.shields.io/codecov/c/github/travi/hapi-react-router.svg )] ( https://codecov.io/github/travi/hapi-react-router )
97
10- [ ![ Commitizen friendly] ( https://img.shields.io/badge/commitizen-friendly-brightgreen.svg )] ( http://commitizen.github.io/cz-cli/ )
11- [ ![ 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 )
12- [ ![ Greenkeeper badge] ( https://badges.greenkeeper.io/travi/hapi-react-router.svg )] ( https://greenkeeper.io/ )
8+ ## Usage
139
14- ## Installation
10+ [ ![ npm] ( https://img.shields.io/npm/v/@travi/hapi-react-router.svg?maxAge=2592000 )] ( https://www.npmjs.com/package/@travi/hapi-react-router )
11+ [ ![ license] ( https://img.shields.io/github/license/travi/hapi-react-router.svg )] ( LICENSE )
12+
13+ ### Installation
1514
1615``` sh
1716$ npm install @travi/hapi-react-router -S
1817```
1918
20- ## Usage
19+ ### Register with your [ Hapi ] ( https://hapijs.com ) v17 server
2120
2221Include this plugin in the [ manifest] ( https://github.com/hapijs/glue ) of your
2322hapi application to direct all requests to ` /html ` to a server-side renderer
@@ -30,19 +29,16 @@ will be triggered and rendering will wait for all related requests to complete.
3029This enables populating the data store based on the components that are mounted
3130for the current route.
3231
33- :warning : [ a regenerator runtime] ( https://babeljs.io/docs/plugins/transform-regenerator/ )
34- is required since this package leverages async functions
35-
3632### Example
3733
3834``` js
3935export default {
40- connections : [ {port: 8090 }] ,
41- registrations : [
42- {plugin : ' @travi/hapi-html-request-router ' },
43- {
44- plugin : {
45- register : ' @travi/hapi-react-router' ,
36+ server : {port: process . env . PORT } ,
37+ register : {
38+ plugins : [
39+ {plugin : ' @travi/hapi-html-request-router ' },
40+ {
41+ plugin : ' @travi/hapi-react-router' ,
4642 options: {
4743 respond : (reply , {renderedContent}) => {
4844 reply .view (' layout' , {renderedContent});
@@ -63,8 +59,8 @@ export default {
6359 configureStore : ({session}) => createStore (reducer, composeMiddlewares (session))
6460 }
6561 }
66- }
67- ]
62+ ]
63+ }
6864}
6965```
7066
@@ -90,7 +86,11 @@ required.
9086 so that your component can inject it into the context through a provider
9187 component.
9288
93- ## Local Development
89+ ## Contribution
90+
91+ [ ![ Commitizen friendly] ( https://img.shields.io/badge/commitizen-friendly-brightgreen.svg )] ( http://commitizen.github.io/cz-cli/ )
92+ [ ![ 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 )
93+ [ ![ Greenkeeper badge] ( https://badges.greenkeeper.io/travi/hapi-react-router.svg )] ( https://greenkeeper.io/ )
9494
9595### Install dependencies
9696
0 commit comments