Entrypoint
Nest.js Extends Toolkit providers a set of providers for creating various types of entrypoints, which come in four types:
BaseScriptEntrypointExecute some code once.BaseDaemonEntrypointRun some code as a daemon.BaseHttpServerEntrypointRunning the HTTP server.BaseMicroserviceEntrypointRunning the Nest Microservice server.
Lifecycle events
Nest.js provides a set of Lifecycle events 1, when you want to use them, you can define the methods directly in the entrypoint class without having to import the relevant interface.
On top of that, Nest.js Extends Toolkit adds an additional Lifecycle event onApplicationListened to BaseHttpServerEntrypoint and BaseMicroserviceEntrypoint which will be called after http server or microservice server listened.
Full lifecycle events sequence:
onModuleInit()onApplicationBootstrap()onApplicationListenedonModuleDestroy()beforeApplicationShutdown()onApplicationShutdown()