Application class serves as the main entry point to initialize and manage the server application lifecycle. It includes the initialization of services, middleware, and routes, as well as handling graceful shutdowns.

Implements

Constructors

Methods

Constructors

Methods

  • Initializes the application by setting up the necessary services, middlewares, and controllers.

    Parameters

    • express: Application

      The Express application instance to be used.

    • process: Process

      The Node.js process instance for handling system-level events.

    Returns Promise<void>

    A promise that resolves once the application initialization is complete.

  • Method that is triggered when the component or service is being destroyed. It performs necessary cleanup operations, such as shutting down ongoing processes.

    Returns void

    Does not return a value.

  • Shuts down the application gracefully by stopping all instances that implement the onDestroy method and removing all process interrupt listeners. Finally, it exits the process.

    Returns void

    This method does not return any value.