A decorator function for defining a PUT HTTP route on a method within a class. This decorator is typically used within a framework to register a method as a handler for PUT requests to a specific route path.

May throw if there are issues with metadata configuration on the target class.

Metadata:

  • routes: Defined on the class, an array of route metadata objects each containing:
    • requestMethod: The HTTP method for the route, which is put for this decorator.
    • path: The route path.
    • middlewares: The middlewares associated with the route.
    • methodName: The name of the method this decorator is applied to.
  • Parameters

    • Optionaloptions: RouteDecoratorOptions

      Optional configuration object for the route. - path: A string representing the path for the route. Defaults to / if not provided. - middlewares: An array of middleware functions to execute before the route handler. Defaults to an empty array.

    Returns MethodDecorator

    A method decorator that assigns metadata to the class, including the request method, path, middlewares, and the method name.