Class: CORE

CORE

CoreController - a class that handles implementing API strategies and providing CRUD operation convenience methods and middleware

Constructor

new CORE(resources, options)

Contructs a new Core instance

Parameters:
Name Type Description
resources Object

Periodicjs shared resources

Properties
Name Type Description
logger Object

A logger module that should be used in logging errors, info and warns

settings Object

Contains various application settings including theme and environment specific configurations

Properties
Name Type Description
compatibility Boolean

If strictly false compatibility mode CoreController will not be initialized and all alias methods will reference their v10 counterparts

app Object

Should contain a locals property that has local data to be shared with constructed object

options Object

Configurable options for adapters and overrides

Properties
Name Type Description
compatibility Boolean

If strictly false compatibility mode CoreController will not be initialized and all alias methods will reference their v10 counterparts

Source:

Methods

initialize_db(options) → {Object}

Initializes database adapters for each given model in configuration and assigns them to the this.db object indexed by model name and assigns a default mongo adapter to the .default property on this.db

Parameters:
Name Type Description
options Object

Configurable options for db adapters (see periodicjs.core.data for more details)

Properties
Name Type Description
db_configuration Object

Configuration for db adapters

Source:
Returns:

"this"

Type
Object

initialize_protocol(options, utilitiesopt) → {Object}

Initializes a protcol adapter and assigns it to the .protocol property on "this". The active protocol adapter is used for sending responses to the client and for setting up an API strategy

Parameters:
Name Type Attributes Default Description
options Object

Configurable options for protocol adapter (see periodicjs.core.protocols for more details)

Properties
Name Type Description
protocol_configuration Object

Configuration for protocol adapter

utilities Object <optional>
CoreUtilities

A set of utility methods that should be accessible by protocol adapter

Source:
Returns:

"this"

Type
Object

initialize_responder(options) → {Object}

Initializes a responder and assigns it to the .responder property on "this". The active responder will also be used as the responder for any protocol adapters initialized after this is called

Parameters:
Name Type Description
options Object

Configurable options for responder (see periodicjs.core.responder for more details)

Properties
Name Type Description
responder_configuration Object

Configuration for response adapter

Source:
Returns:

"this"

Type
Object