Skip to main content

Class: Bootstrap

@ima/core.Bootstrap

Application bootstrap used to initialize the environment and the application itself.

Constructors

constructor

new Bootstrap(oc)

Initializes the bootstrap.

Parameters

NameTypeDescription
ocObjectContainerThe application's object container to use for managing dependencies.

Defined in

packages/core/src/Bootstrap.ts:133

Properties

_config

Protected _config: BootConfig

Defined in

packages/core/src/Bootstrap.ts:125


_oc

Protected _oc: ObjectContainer

Defined in

packages/core/src/Bootstrap.ts:124

Methods

_bindDependencies

_bindDependencies(): void

Binds the constants, service providers and class dependencies to the object container.

Returns

void

Defined in

packages/core/src/Bootstrap.ts:266


_bindPluginDependencies

_bindPluginDependencies(name, plugin): void

Binds the constants, service providers and class dependencies to the object container for dynamically imported plugins.

Parameters

NameTypeDescription
namestringPlugin name.
pluginInitPluginConfigPlugin interface (object with init functions).

Returns

void

Defined in

packages/core/src/Bootstrap.ts:298


_initPluginServices

_initPluginServices(plugin): void

Service initialization for the dynamically loaded plugins.

Parameters

NameTypeDescription
pluginInitPluginConfigPlugin interface (object with init functions).

Returns

void

Defined in

packages/core/src/Bootstrap.ts:336


_initPluginSettings

_initPluginSettings(name, plugin): void

Initializes dynamically loaded plugin settings (if the init function is provided). The settings are merged into the application the same way as with non-dynamic import, meaning the app setting overrides are prioritized over the default plugin settings.

Parameters

NameTypeDescription
namestringPlugin name.
pluginInitPluginConfigPlugin interface (object with init functions).

Returns

void

Defined in

packages/core/src/Bootstrap.ts:230


_initRoutes

_initRoutes(): void

Initializes the routes.

Returns

void

Defined in

packages/core/src/Bootstrap.ts:311


_initServices

_initServices(): void

Initializes the basic application services.

Returns

void

Defined in

packages/core/src/Bootstrap.ts:319


_initSettings

_initSettings(): void

Initializes the application settings. The method loads the settings for all environments and then picks the settings for the current environment.

The method also handles using the values in the production environment as default values for configuration items in other environments.

Returns

void

Defined in

packages/core/src/Bootstrap.ts:186


initPlugin

initPlugin(name, plugin?): void

Initializes dynamically loaded plugin. This is explicitly called from within the Plugin Loader instance.

Parameters

NameTypeDescription
namestringPlugin name.
plugin?InitPluginConfigPlugin interface (object with init functions).

Returns

void

Defined in

packages/core/src/Bootstrap.ts:169


run

run(config): void

Initializes the application by running the bootstrap sequence. The sequence initializes the components of the application in the following order:

  • application settings
  • constants, service providers and class dependencies configuration
  • services
  • UI components
  • routing

Parameters

NameTypeDescription
configBootConfigThe application environment configuration for the current environment.

Returns

void

Defined in

packages/core/src/Bootstrap.ts:153