MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / start

Method start

packages/core/src/application.ts:355–367  ·  view source on GitHub ↗

* Start the application, and all of its registered observers. The application * state is checked to ensure the integrity of `start`. * * If the application is not initialized, it calls first `init()` to * initialize the application. This only happens if `start()` is called for * the f

()

Source from the content-addressed store, hash-verified

353 * If the application is already started, no operation is performed.
354 */
355 public async start(): Promise<void> {
356 if (!this._initialized) await this.init();
357 if (this._state === 'starting') return this.awaitState('started');
358 this.assertNotInProcess('start');
359 // No-op if it's started
360 if (this._state === 'started') return;
361 this.setState('starting');
362 this.setupShutdown();
363
364 const registry = await this.getLifeCycleObserverRegistry();
365 await registry.start();
366 this.setState('started');
367 }
368
369 /**
370 * Register a function to be called when the application starts.

Callers 1

mainFunction · 0.95

Calls 7

initMethod · 0.95
awaitStateMethod · 0.95
assertNotInProcessMethod · 0.95
setStateMethod · 0.95
setupShutdownMethod · 0.95
startMethod · 0.65

Tested by 1

mainFunction · 0.76