* Initializes the Nest application. * Calls the Nest lifecycle events. * * @returns {Promise<this>} The NestApplicationContext instance as Promise
()
| 251 | * @returns {Promise<this>} The NestApplicationContext instance as Promise |
| 252 | */ |
| 253 | public async init(): Promise<this> { |
| 254 | if (this.isInitialized) { |
| 255 | return this; |
| 256 | } |
| 257 | /* eslint-disable-next-line no-async-promise-executor */ |
| 258 | this.initializationPromise = new Promise(async (resolve, reject) => { |
| 259 | try { |
| 260 | await this.callInitHook(); |
| 261 | await this.callBootstrapHook(); |
| 262 | resolve(); |
| 263 | } catch (err) { |
| 264 | reject(err); |
| 265 | } |
| 266 | }); |
| 267 | await this.initializationPromise; |
| 268 | |
| 269 | this.isInitialized = true; |
| 270 | return this; |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Terminates the application |
nothing calls this directly
no test coverage detected