Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Apis

APIs are an abstraction for AWS Lambda functions.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Apis(rootPath: string): Apis
  • Create a new instance by providing a folder path.

    Will populate the filePaths property with the result of the listFiles method using the rootPath as a parameter.

    Parameters

    • rootPath: string

      absolute folder where to load files from

    Returns Apis

Properties

filePaths

filePaths: string[] = []

array of files (absolute paths) inside the given rootPath

modules

modules: any[] = []

array of modules, 1:1 mapped to the filePaths compiled from source

rootPath

rootPath: string

the folder where the files are located

Accessors

functions

  • get functions(): object
  • Accessor for functions with special serverless lambda syntax.

    Returns object

Methods

listFiles

  • listFiles(cwd: string): string[]
  • Convenience method for loading files recursively from a folder. Returns an array of file paths as strings. Will be called from the constructor with the pre-filled rootPath.

    Parameters

    • cwd: string

      the absolute path where to search for files from

    Returns string[]

loadModule

  • loadModule(filePath: string): any
  • Read and compile a javascript module directly. Is NOT cached and does NOT use the native 'require' naively. This should work even when mocked.

    Parameters

    • filePath: string

    Returns any

Generated using TypeDoc