# EndpointMetadata Class

Module
import { EndpointMetadata } from "@tsed/common"
Source/packages/common/src/mvc/models/EndpointMetadata.ts

# Overview

class EndpointMetadata extends Storable implements EndpointConstructorOptions {
    beforeMiddlewares: any[];
    middlewares: any[];
    afterMiddlewares: any[];
    /**
     * Route strategy.
     */
    pathsMethods: IPathMethod[];
    readonly responses: Map<number, IResponseOptions>;
    statusCode: number;
    /**
     * Endpoint inherited from parent class.
     */
    readonly parent: EndpointMetadata | undefined;
    constructor(options: EndpointConstructorOptions);
    get type(): Type<any>;
    set type(type: Type<any>);
    /**
     * @deprecated
     */
    get methodClassName(): string;
    /**
     *
     * @returns {Store}
     */
    get store(): Store;
    get params(): import("./ParamMetadata").ParamMetadata[];
    get response(): IResponseOptions;
    /**
     * Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
     *
     * @param key
     * @returns {any}
     */
    get(key: any): any;
    /**
     * Change the type and the collection type from the status code.
     * @param {string | number} code
     * @deprecated Use endpoint.responses.get(code)
     */
    statusResponse(code: string | number): IResponseOptions;
    /**
     *
     * @param args
     * @returns {EndpointMetadata}
     */
    before(args: any[]): this;
    /**
     *
     * @param args
     * @returns {EndpointMetadata}
     */
    after(args: any[]): this;
    /**
     * Store all arguments collected via Annotation.
     * @param args
     */
    merge(args: any[]): this;
}

# Description

EndpointMetadata contains metadata about a controller and his method. Each annotation (@Get, @Body...) attached to a method are stored in a endpoint. EndpointMetadata convert this metadata to an array which contain arguments to call an Express method.

Example :

@Controller("/my-path") provide MyClass {

   @Get("/")
   @Authenticated()
   public myMethod(){}

}