Skip to main content
Version: 0.1.2

Applications

Application bootstrapping and lifecycle management

Classes​

ApplicationExpress​

Defined in: packages/core/src/core/applications/ApplicationExpress.ts:15

Internal

Internal Express application wrapper that handles route registration from decorated controller classes.

This class is used internally by ServerBuilder and should not be instantiated directly.

Constructors​

Constructor​
new ApplicationExpress(routes): ApplicationExpress;

Defined in: packages/core/src/core/applications/ApplicationExpress.ts:32

Creates a new ApplicationExpress instance.

Parameters​
routes​

unknown[]

Array of controller classes decorated with

Returns​

ApplicationExpress

Controller​

Accessors​

instance​
Get Signature​
get instance(): Application;

Defined in: packages/core/src/core/applications/ApplicationExpress.ts:24

Returns the underlying Express application instance.

Returns​

Application

Methods​

registerRouters()​
registerRouters(): void;

Defined in: packages/core/src/core/applications/ApplicationExpress.ts:52

Registers all routes from the controller classes. Reads metadata from decorators and creates Express routes accordingly. Prints a table of registered routes to the console.

Returns​

void


ApplicationPreCheck​

Defined in: packages/core/src/core/applications/ApplicationPreCheck.ts:18

Default implementation of application pre-flight checks. Verifies database connectivity before the application starts.

Example​

const preCheck = container.get<IApplicationPreCheck>(INVERSITY_TYPES.ApplicationPreCheck);
await preCheck.startCheck();

Implements​

Constructors​

Constructor​
new ApplicationPreCheck(entityManager, loggerFactory): ApplicationPreCheck;

Defined in: packages/core/src/core/applications/ApplicationPreCheck.ts:22

Parameters​
entityManager​

IDatabaseManagerFactory

loggerFactory​

ILoggerFactory

Returns​

ApplicationPreCheck

Methods​

startCheck()​
startCheck(): Promise<void>;

Defined in: packages/core/src/core/applications/ApplicationPreCheck.ts:36

Runs all pre-flight checks including database connectivity. Logs the status of each check.

Returns​

Promise<void>

Implementation of​

IApplicationPreCheck.startCheck

Interfaces​

IApplicationPreCheck​

Defined in: packages/core/src/core/applications/types.ts:6

Interface for application pre-flight checks. Implementations should verify that all required services (database, etc.) are available before the application starts accepting requests.

Methods​

startCheck()​
startCheck(): Promise<void>;

Defined in: packages/core/src/core/applications/types.ts:11

Runs all pre-flight checks. Should throw an error if any check fails.

Returns​

Promise<void>