RouterConfig: TransactionConfig & {
    containerSetupHook?: ((server: HTTPServer, app: express.Express) => Promise<void>);
    cors?: {
        allowCredentials?: boolean;
        headers?: string[];
        origin?: string | string[];
    };
    healthCheckRoute?: string;
    port?: number;
    routes: AnyRoute[];
    timeout?: number;
}

Represents the configuration options for a router.

Type declaration

  • OptionalcontainerSetupHook?: ((server: HTTPServer, app: express.Express) => Promise<void>)

    Optional hook function that sets up the container with the provided HTTP server and Express app.

      • (server, app): Promise<void>
      • Parameters

        • server: HTTPServer

          The HTTP server instance.

        • app: express.Express

          The Express application instance.

        Returns Promise<void>

        A promise that resolves when the setup is complete.

  • Optionalcors?: {
        allowCredentials?: boolean;
        headers?: string[];
        origin?: string | string[];
    }

    Configuration options for Cross-Origin Resource Sharing (CORS).

    • OptionalallowCredentials?: boolean
    • Optionalheaders?: string[]
    • Optionalorigin?: string | string[]
  • OptionalhealthCheckRoute?: string

    The route for the health check endpoint.

  • Optionalport?: number

    The port number for the server to listen on.

  • routes: AnyRoute[]

    An array of route objects representing the available routes in the application.

  • Optionaltimeout?: number

    Optional timeout value in milliseconds.