hapi-base
Quick Start
Make a new repo for your server, and add hapi-base
as a dependency.
Create a config file:
// config.jsvar MyPlugin = moduleexports = partitions: domains: 'necrotizing-pineapple.com' plugins: MyPlugin
Create an index file:
// index.jsvar startCluster = startCluster
Configuration Options
config.partitions
The most important configuration option, this is an array of partitions.
A partition looks like this:
domains: 'necrotizing-pineapple.com' plugins: MyPlugin
This says "handle connections that come from these domains with these plugins". We do it this way to keep route configuration separate from the hapi-base
repo.
Internally, labels are derived from the domains and used to route the connections to the right place.