MCPcopy
hub / github.com/nestjs/nest / init

Method init

packages/core/nest-application-context.ts:253–271  ·  view source on GitHub ↗

* Initializes the Nest application. * Calls the Nest lifecycle events. * * @returns {Promise<this>} The NestApplicationContext instance as Promise

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

callInitHookMethod · 0.95
callBootstrapHookMethod · 0.95

Tested by

no test coverage detected