Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Detective

A Detective instance manages registered dependencies and endpoints. Dependencies can be registered with an instance. Each instance has a state which represents the health of its components.

Hierarchy

  • Detective

Index

Constructors

Methods

Constructors

constructor

  • Parameters

    • name: string

      Name of the application. Names of a connected group of detective instances should be unique among that group

    Returns Detective

Methods

dependency

  • Adds a new dependency to the Detective instance. The name provided should preferably be unique among dependencies registered within the same detective instance.

    Parameters

    • name: string

      Name of the dependency

    Returns Dependency

endpoint

  • endpoint(url: string, options?: RequestOptions): void
  • Adds an HTTP endpoint as a dependency to the Detective instance, thereby allowing you to compose detective instances. This method creates a GET request to the provided url. If you want to customize the request (like using a different HTTP method, or adding headers), consider using the options argument.

    Parameters

    Returns void

handler

  • handler(): function
  • Returns a standard HTTP handler function, which can be used with the http standard library module, or frameworks like express

    Returns function

      • (req: IncomingMessage, res: ServerResponse): void
      • Parameters

        • req: IncomingMessage
        • res: ServerResponse

        Returns void

Generated using TypeDoc