Hapi redirect
A small library for redirecting requests based on http/s status code to another endpoint
Installation
npm install --save hapi-redirect
Usage
'use strict' const Hapi = ; const server = port: 3000 ; server
API
hapi-redirect
hapi-redirect.plugin
options
Object with the following keysactions
{array} List with redirect actionsstatus_code
{string} Request status code to redirect e.g. 401 - unauthorizedredirect(url)
{function} Function that should return{ url: ..., [host:...]}
url
Current url to be redirected from if redirect should be done or null if not
Kind: static property of hapi-redirect
Tests
npm run-script test-locally
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.