@swizzyweb/swizzy-web-service
    Preparing search index...

    Class WebController<ROUTER_STATE, CONTROLLER_STATE>Abstract

    Base web controller class to be used by routers.

    Type Parameters

    • ROUTER_STATE
    • CONTROLLER_STATE

    Implements

    Index

    Constructors

    Properties

    action: string

    Url Action, ie: /service/router/controller <-- this.

    actualController?: WebControllerFunction

    Configured in initialize.

    logger: ILogger<any>

    Logger

    Htto method.

    name: string

    Display name for this controller.

    Converts router state to this controller state.

    isWebController: true

    Methods

    • Returns the resolved middleware functions to be applied before this controller. Each SwizzyMiddleware factory is invoked with the current state and logger.

      Returns SwizzyMiddlewareFunction[]

      array of Express middleware functions

    • Returns the current controller-level state, or undefined if not yet initialized.

      Returns CONTROLLER_STATE | undefined

    • Serializes the controller to a plain JSON-compatible object. Logger is omitted for safety.

      Returns {
          action: string;
          logger: undefined;
          method: RequestMethod;
          middleware: any[];
          name: string;
          stateConverter: { name: string };
      }

      JSON representation of this controller

    • Returns a JSON string representation of this controller.

      Returns string

      stringified JSON of the controller