1.1.1 • Published 10 years ago

hapi-base v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
10 years ago

hapi-base

Quick Start

Make a new repo for your server, and add hapi-base as a dependency.

Create a config file:

// config.js
var MyPlugin = require('my-plugin')

module.exports = {
    partitions: [
        {
            domains: ['necrotizing-pineapple.com']
        ,   plugins: [MyPlugin]
        }
    ]
}

Create an index file:

// index.js
var startCluster = require('hapi-base').startCluster
  , require('./config.js')

startCluster(config)

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.

1.1.1

10 years ago

1.1.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago