Class: Endpoint

Endpoint(setup)

new Endpoint(setup)

Creates a new instance of the Endpoint class.

Parameters:
Name Type Description
setup Object

The setup object containing endpoint details and configurations.

Properties
Name Type Description
method string

The HTTP method for the endpoint (default: 'GET').

routePath string

The path of the endpoint's route.

controller function

The controller function handling the endpoint logic.

bodySchema Object

The schema object for validating the request body.

isAuthRoute boolean

Indicates if the endpoint requires authentication.

authRule string

The authorization rule for the authenticated users.

middlewares Array.<function()>

Additional middlewares to be applied to the endpoint.

noValidateBody boolean

Indicates if request body validation should be skipped.

Source:
Throws:

If setup parameters are invalid.

Type
Error.Log

Members

controller :function

The controller function handling the endpoint logic.

Type:
  • function
Source:

method :string

The HTTP method for the endpoint.

Type:
  • string
Source:

middlewares :Array.<function()>

Middleware functions to be applied to the endpoint.

Type:
  • Array.<function()>
Source:

routePath :string

The path of the endpoint's route.

Type:
  • string
Source: