1.0.0 • Published 7 years ago

prefix-hapi v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Prefix-hapi

Makes it possible to use route groups (prefixed routes) within your hapi application.

Installation NPM

npm install prefix-hapi

Installation GitHub

Clone the repository and install the dependencies

npm install 

Follow the start instructions to continue

Usage

setServer(server)

Set the server so we can use it within prefix-hapi.

Example:

If you do not have babel configured use the following line to import prefix-hapi:

Create a route handler

Make a handler which you can place in a route.

Example:

server.prefix(prefix, {route: handler})

Set the prefix and the routes.

  • prefix the prefix of all the routes
  • route define a route which will be under the prefix
  • handler should be a function and it is recommended to use a handler

Example:

Start

Build:

npm run build

Run:

npm run serve

For development:

npm start