api-tools-ts
    Preparing search index...

    Class APIController

    Index

    Constructors

    Properties

    endpoints: Map<string, EndpointCallback | ParameterCallback>

    A map containing all endpoints of this API

    hostname: string

    Bind the API to a different IP Address

    mainEndPoint: string

    the main endpoint for this API

    middlewares: Map<string, MiddleWareCallback>

    A Map containing all used middlewares for this API

    parameters: Map<string, ParameterCallback>

    A Map containing all parameters checker functions for this API

    port: number

    The API Server PORT. Default: 3000

    Methods

    • Legacy method for backward compatibility

      Parameters

      • endpoint: string
      • method: string[]
      • callback: any

      Returns void

    • Gets server information

      Returns { hostname: string; isRunning: boolean; mainEndPoint: string; port: number }

    • Starts the express server with improved configuration

      Parameters

      • OptionallegacyConfig: { useDefaultMiddlewares: string }

      Returns Promise<void>