I have a file in my Downloads folder which I want to send to aws lambda endpoint.
import * as fs from 'fs';
import { APIGatewayProxyEvent } from 'aws-lambda';
let filepath = '/Users/myUserName/Downloads/test.jpg';
let filedata = fs.readFileSync(filepath);
let event = {body: filedata} as APIGatewayProxyEvent;
But I am getting an error
Conversion of type '{ body: Buffer; }' to type 'APIGatewayProxyEvent' may be a mistake because neither type sufficiently overlaps with the other.
Should I be sending file data using other than body field?