1.0.0 • Published 7 years ago
prefix-hapi v1.0.0
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 routesroute
define a route which will be under the prefixhandler
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
1.0.0
7 years ago