Home Reference Source Repository
import {Endpoint} from 'test-rest/src/components/endpoint.js'
public class | source

Endpoint

This component is responsible for generating the correct routes for the endpoint and it's child endpoints. It also stores the current state of the endpoint.

Constructor Summary

Public Constructor
public

constructor(config: EndpointConfig, parent: Endpoint)

Creates a new instance of Endpoint.

Member Summary

Public Members
public get

Gets the current configuration and state of the endpoint.

public get

route: Array: *

Gets the generated routes for the endpoint.

public get

routes: Array<T>: *

Gets the generates routes for the endpoint and all its child endpoints.

Method Summary

Public Methods
public

Generates the routes for the endpoint based on EndpointConfig.methods.

Public Constructors

public constructor(config: EndpointConfig, parent: Endpoint) source

Creates a new instance of Endpoint.

Params:

NameTypeAttributeDescription
config EndpointConfig

The configuration for the endpoint.

parent Endpoint
  • optional

The parent endpoint of this endpoint.

Public Members

public get currentState: EndpointConfig: * source

Gets the current configuration and state of the endpoint.

Return:

EndpointConfig

public get route: Array: * source

Gets the generated routes for the endpoint.

Return:

Array

public get routes: Array<T>: * source

Gets the generates routes for the endpoint and all its child endpoints.

Return:

Array<T>

Public Methods

public createRoutes() source

Generates the routes for the endpoint based on EndpointConfig.methods.