Get is a function that acts as a decorator for defining HTTP GET route handlers in a web application. It allows specifying options for the route, including the path and any associated middleware.

  • Parameters

    • Optionaloptions: RouteDecoratorOptions

      Optional configuration for the route. - path: The URL path of the route (default is '/'). - middlewares: An array of middleware functions to apply to the route (default is an empty array).

    Returns MethodDecorator

    • A method decorator function to bind route metadata to the target method.

    The decorator stores metadata about the HTTP route, such as the request method, path, middleware, and method name, using reflection. This metadata can be used by the framework to register and configure routes in the application.