Create a new lambda app.
Optional
controllersPath: string[](Optional) Paths to the directories that contain controller js
files.
Required if the default Container
is used, or the provided
Container
instance has its autobind
flag enabled.
Ignored if the provided Container
instance has its autobind
flag enabled.
Optional
appConfig: AppConfig(Optional) Application config to pass to lambda-api
.
Optional
autoInjectionEnabled: boolean(Optional) Enable auto injection in IOC container, defaults to new true
.
Optional
appContainer: Container(Optional) InversifyJS
IOC Container
instance which can
build controllers and error interceptors, defaults to new Container
using
autobind
flag set to true
if autoInjectionEnabled
is true
.
Protected
Readonly
apiProtected
app(Optional) Application config to pass to lambda-api
, defaults to new AppConfig
.
Protected
app(Optional) InversifyJS
IOC Container
instance which can
build controllers and error interceptors, defaults to new Container
using
autobind
flag set to true
if autoInjectionEnabled
is true
. If you pass your own
instance autoInjectionEnabled
must reflect the autobind flag passed to the Container.
Protected
auto(Optional) Is auto injection enabled in the IOC container? Defaults to true
.
Protected
Optional
Readonly
controllers(Optional) Paths to the directories that contain controller js
files that
declare controllers. Required if the default Container
is used, or the
autoInjectionEnabled
is set to true
. Ignored if the autoInjectionEnabled
is set to false
.
Protected
initialisedProtected
Readonly
logProtected
loggerConfigure the API
instance from the lambda-api
package.
Function that takes an API
instance as a parameter.
Configure the InversifyJS
IOC Container
instance.
Function that takes a Container
instance as a parameter.
Initialise all controllers and endpoints declared using decorators.
Process the passed lambda event and context as a synchronous HTTP request.
API Gateway or ALB request.
Request context.
The response.
Impementation of the
ApiApp
class that handles native AWS Lambda requests and can be used to provide a Lambda function handler.The
run
method is the function handler entrypoint.