🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

hapi-base

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-base

## Quick Start

latest
npmnpm
Version
1.1.1
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 12 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts