Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LambdaServer

The LambdaServer wraps a Node.js Lambda routine in a simple HTTP service.

It makes it easy to test Lambdas locally, and in conjunction with our other tools.

To use it, simply provide the filename of the Lambda function along with the port the HTTP server should listen on.

Hierarchy

  • LambdaServer

Index

Constructors

Methods

Constructors

constructor

  • new LambdaServer(file?: string, port?: number, verbose?: boolean, functionName?: string): LambdaServer
  • Creates a server that exposes a Lambda as an HTTP service

    Parameters

    • Optional file: string

      The file the defines the Lambda

    • Optional port: number

      The port the service should listen on

    • Optional verbose: boolean

      Prints out verbose information about requests and responses

    • Optional functionName: string

      Use the named function as opposed to the default ("handler")

    Returns LambdaServer

Methods

start

  • start(callback?: function): void
  • Starts the LambdaServer listening on the port specified in the constructor.

    Parameters

    • Optional callback: function

      Called once the server has started successfully

        • (): void
        • Returns void

    Returns void

stop

  • stop(onStop?: function): void
  • Stops the lambda service

    Parameters

    • Optional onStop: function

      Callback when all sockets related to the LambdaServer have been cleaned up

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc