API Docs for: 0.8.0
Show:

PencilBlue Class

Defined in: pencilblue.js:30
Module: Services

The main driver file for PencilBlue. Provides the function necessary to start up the master and/or child processes. In addition, it is responsible for ensuring that all system services are available by requiring the "requirements.js" file.

Constructor

PencilBlue

()

Defined in pencilblue.js:30

Methods

init

()

Defined in pencilblue.js:58

To be called when the configuration is loaded. The function is responsible for triggered the startup of the HTTP connection listener as well as start a connection pool to the core DB.

initCommandService

(
  • cb
)
static

Defined in pencilblue.js:317

Initializes the command service by calling its "init" function.

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, [RESULT])

initDBConnections

(
  • cb
)
static

Defined in pencilblue.js:174

Attempts to initialize a connection pool to the core database

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, Boolean)

initDBIndices

(
  • cb
)
static

Defined in pencilblue.js:195

Checks to see if the process should verify that the indices are valid and in place.

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, Boolean)

initLibraries

(
  • cb
)
static

Defined in pencilblue.js:327

Initializes the libraries service

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, [RESULT])

initLogWrappers

(
  • cb
)
static

Defined in pencilblue.js:98

Ensures that any log messages by the NPM module are forwarded as output to the system logs

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, Boolean)

initPlugins

(
  • cb
)
static

Defined in pencilblue.js:136

Initializes the installed plugins.

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, Boolean)

initRequestHandler

(
  • cb
)
static

Defined in pencilblue.js:115

Initializes the request handler. This causes all system routes to be registered.

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, Boolean)

initServer

(
  • cb
)
static

Defined in pencilblue.js:214

Initializes the HTTP server(s). When SSL is enabled two servers are created. One to handle incoming HTTP traffic and one to handle HTTPS traffic.

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, Boolean)

initServerRegistration

(
  • cb
)
static

Defined in pencilblue.js:307

Initializes server registration.

Parameters:

  • cb Function

    A callback that provides two parameters: cb(Error, [RESULT])

initSessions

(
  • cb
)

Defined in pencilblue.js:127

Starts the session handler

Parameters:

  • cb Function

initSiteMigration

(
  • cb
)
static

Defined in pencilblue.js:152

Move a single tenant solution to a multi-tenant solution.

Parameters:

  • cb Function
    • callback function

initSites

(
  • cb
)
static

Defined in pencilblue.js:163

Initializes site(s).

Parameters:

  • cb Function
    • callback function

onHttpConnect

(
  • req
  • res
)
static

Defined in pencilblue.js:253

The function that handles normal server traffic. The function ensures that the incoming request is delegated out appropriately. When SSL Termination is in use if the 'x-forwarded-proto' header does equal 'https' then the request is delegated to the handoff function so the request can be redirected appropriately.

Parameters:

  • req Request

    The incoming request

  • res Response

    The outgoing response

onHttpConnectForHandoff

(
  • req
  • res
)
static

Defined in pencilblue.js:283

Handles traffic that comes in for HTTP when SSL is enabled. The request is redirected to the appropriately protected HTTPS url.

Parameters:

  • req Request

    The incoming request

  • res Response

    The outgoing response

registerMetrics

(
  • cb
)
static

Defined in pencilblue.js:337

Initializes the metric registrations to measure request counts

Parameters:

  • cb Function

start

()

Defined in pencilblue.js:363

Starts up the instance of PencilBlue

startInstance

() PencilBlue static

Defined in pencilblue.js:376

The default entry point to a stand-alone instance of PencilBlue

Returns:

Properties

pb

Object private static

Defined in pencilblue.js:40

requestsServed

Integer private static

Defined in pencilblue.js:49

The number of requests served by this instance