Which type do I return with AWS lambda responses in typescript to suite AWS APIGateway Method Response? - Stack Overflow

PHOTO EMBED

Sun Mar 20 2022 09:37:01 GMT+0000 (Coordinated Universal Time)

Saved by @joel113 #javascript

import { APIGatewayProxyEvent, Context, APIGatewayProxyResult } from "aws-lambda"

export async function hello (event: APIGatewayProxyEvent, context: Context): Promise<APIGatewayProxyResult> {
  return {
    statusCode: 200,
    body: JSON.stringify({
      message: 'Hello world',
      input: event,
    })
  }
}
content_copyCOPY

https://stackoverflow.com/questions/53976371/which-type-do-i-return-with-aws-lambda-responses-in-typescript-to-suite-aws-apig