Class ApiConsoleApp

Simple console application that hosts an express HTTP server.

A request is mapped from the HTTP request to the ApiServer event format, a ApiServer instance then processes the request. The ApiServer response is mapped to a standard HTTP response and returned to the express client.

Hierarchy

  • ApiApp
    • ApiConsoleApp

Constructors

  • Builds an new console app.

    If a value forappConfig is not passed, the serverLogger property is missing or the serverLogger.logTimestamp property is missing timestamps will be enabled for logger output.

    Parameters

    • controllersPath: string[]
    • Optional appConfig: AppConfig
    • Optional appContainer: Container

    Returns ApiConsoleApp

Properties

apiServer: Server
appConfig: AppConfig
appContainer: Container
controllersPath?: string[]
expressApp: Application
initialised: boolean
logFactory: LogFactory
logger: ILogger

Accessors

  • get middlewareRegistry(): MiddlewareRegistry
  • Returns MiddlewareRegistry

Methods

  • Configure the API instance from the lambda-api package.

    Parameters

    • configureBlock: ((this, api) => void)
        • (this, api): void
        • Parameters

          • this: void
          • api: API

          Returns void

    Returns void

  • Configure the InversifyJS IOC Container instance.

    Parameters

    • configureBlock: ((this, container) => void)

      Function that takes a Container instance as a parameter.

        • (this, container): void
        • Parameters

          • this: void
          • container: Container

          Returns void

    Returns void

  • Initialise all controllers and endpoints declared using decorators.

    Returns Promise<void>

  • Parameters

    • request: ApiRequest
    • context: any

    Returns Promise<ApiResponse>

  • Starts the express server.

    Parameters

    • args: string[]

      Command line arguments for this server, see --help for more info.

    Returns Promise<void>

Generated using TypeDoc