Skip to main content

getCurrentInvoke

@h4ad/serverless-adapter > getCurrentInvoke

(function) getCurrentInvoke

Get the reference to the event created by the serverless trigger or context created by the serverless environment.

Signature:

export declare function getCurrentInvoke<TEvent = any, TContext = any>(): CurrentInvoke<TEvent, TContext>;

Returns:

CurrentInvoke <TEvent, TContext>

Example

import type \{ ALBEvent, Context } from 'aws-lambda';

// inside the method that handles the aws alb request.
const \{ event, context } = getCurrentInvoke<ALBEvent, Context>();