Skip to main content

Quickstart

import { Module } from '@quik/bootstrap';

await Module.setup({
core: { logging, i18n },
modules: [],
flags: {
isCli: false,
startHttpServer: true,
startWebSocketServer: false,
startScheduler: false,
isTest: false
}
});

await Module.init();
await Module.boot();

Registering lifecycle hooks

import { onBeforeBoot, onBoot, onAfterBoot } from '@quik/bootstrap';

onBeforeBoot(async () => {
// prepare resources
});

onBoot(async () => {
// start services
});

onAfterBoot(async () => {
// post-boot checks
});

Notes

  • Hooks run in order: BEFORE_INIT -> INIT -> AFTER_INIT, then BEFORE_BOOT -> BOOT -> AFTER_BOOT.
  • Callbacks for a given step execute sequentially in registration order; a callback that throws is logged but does not stop the remaining callbacks.
  • logging/i18n above are IQModule definitions (e.g. from @quik/core) required by IQBootstrapSetup.core.