# Functions

The ./src/index.js file (or ./src/index.ts file in a TypeScript-based project) includes global register, bootstrap and destroy functions that can be used to add dynamic and logic-based configurations.

# Register

The register lifecycle function, found in ./src/index.js (or in ./src/index.ts), is an asynchronous function that runs before the application is initialized. It can be used to:

# Bootstrap

The bootstrap lifecycle function, found in ./src/index.js (or in ./src/index.ts), is called at every server start.

It can be used to:

The bootstrap function can be synchronous, asynchronous, or return a promise:

Synchronous function

Asynchronous function

Function returning a promise

# Destroy

The destroy function, found in ./src/index.js (or in ./src/index.ts), is an asynchronous function that runs before the application gets shut down.

It can be used to gracefully: