1.0.0 • Published 9 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-hapiInstallation 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.
prefixthe prefix of all the routesroutedefine a route which will be under the prefixhandlershould be a function and it is recommended to use a handler
Example:
Start
Build:
npm run buildRun:
npm run serveFor development:
npm start1.0.0
9 years ago