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, thenBEFORE_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/i18nabove areIQModuledefinitions (e.g. from@quik/core) required byIQBootstrapSetup.core.