• Decorator function for defining a controller in a web application. It assigns metadata such as prefix, default middleware, and routes to a class.

    Type Parameters

    Parameters

    • Optionaloptions: ControllerDecoratorOptions

      Optional configuration for the controller.

      Represents options for configuring a controller decorator.

      This interface provides support for defining configurations such as route prefix and middleware functions to be applied to the controller.

      • Optionalmiddlewares?: MIDDLEWARE[]

        Optional list of middleware to be executed for the controller.

      • Optionalprefix?: string

        Optional route prefix that will be applied to all endpoints of the controller.

    Returns GenericClassDecorator<Type<T>>

    Returns a class decorator that applies the controller configuration.