1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import {
|
7 | Application,
|
8 | BindingScope,
|
9 | Component,
|
10 | CoreBindings,
|
11 | inject,
|
12 | } from '@loopback/core';
|
13 | import {
|
14 | ApplicationMetadataBooter,
|
15 | ControllerBooter,
|
16 | DataSourceBooter,
|
17 | InterceptorProviderBooter,
|
18 | LifeCycleObserverBooter,
|
19 | ModelApiBooter,
|
20 | ModelBooter,
|
21 | RepositoryBooter,
|
22 | ServiceBooter,
|
23 | } from './booters';
|
24 | import {Bootstrapper} from './bootstrapper';
|
25 | import {BootBindings} from './keys';
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export class BootComponent implements Component {
|
33 |
|
34 |
|
35 | booters = [
|
36 | ApplicationMetadataBooter,
|
37 | ControllerBooter,
|
38 | RepositoryBooter,
|
39 | ServiceBooter,
|
40 | DataSourceBooter,
|
41 | LifeCycleObserverBooter,
|
42 | InterceptorProviderBooter,
|
43 | ModelApiBooter,
|
44 | ModelBooter,
|
45 | ];
|
46 |
|
47 | |
48 |
|
49 |
|
50 |
|
51 | constructor(@inject(CoreBindings.APPLICATION_INSTANCE) app: Application) {
|
52 |
|
53 | app
|
54 | .bind(BootBindings.BOOTSTRAPPER_KEY)
|
55 | .toClass(Bootstrapper)
|
56 | .inScope(BindingScope.SINGLETON);
|
57 | }
|
58 | }
|