UNPKG

1.94 kBJavaScriptView Raw
1"use strict";
2// Copyright IBM Corp. and LoopBack contributors 2018,2020. All Rights Reserved.
3// Node module: @loopback/boot
4// This file is licensed under the MIT License.
5// License text available at https://opensource.org/licenses/MIT
6Object.defineProperty(exports, "__esModule", { value: true });
7exports.BootComponent = void 0;
8const tslib_1 = require("tslib");
9const core_1 = require("@loopback/core");
10const booters_1 = require("./booters");
11const bootstrapper_1 = require("./bootstrapper");
12const keys_1 = require("./keys");
13/**
14 * BootComponent is used to export the default list of Booter's made
15 * available by this module as well as bind the BootStrapper to the app so it
16 * can be used to run the Booters.
17 */
18let BootComponent = class BootComponent {
19 /**
20 *
21 * @param app - Application instance
22 */
23 constructor(app) {
24 // Export a list of default booters in the component so they get bound
25 // automatically when this component is mounted.
26 this.booters = [
27 booters_1.ApplicationMetadataBooter,
28 booters_1.ControllerBooter,
29 booters_1.RepositoryBooter,
30 booters_1.ServiceBooter,
31 booters_1.DataSourceBooter,
32 booters_1.LifeCycleObserverBooter,
33 booters_1.InterceptorProviderBooter,
34 booters_1.ModelApiBooter,
35 booters_1.ModelBooter,
36 ];
37 // Bound as a SINGLETON so it can be cached as it has no state
38 app
39 .bind(keys_1.BootBindings.BOOTSTRAPPER_KEY)
40 .toClass(bootstrapper_1.Bootstrapper)
41 .inScope(core_1.BindingScope.SINGLETON);
42 }
43};
44BootComponent = tslib_1.__decorate([
45 tslib_1.__param(0, (0, core_1.inject)(core_1.CoreBindings.APPLICATION_INSTANCE)),
46 tslib_1.__metadata("design:paramtypes", [core_1.Application])
47], BootComponent);
48exports.BootComponent = BootComponent;
49//# sourceMappingURL=boot.component.js.map
\No newline at end of file