Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Marner MichaelMarner

View GitHub Profile
@MichaelMarner
MichaelMarner / lambda.ts
Last active Nov 3, 2017
Lambda image resize APIGateway
View lambda.ts
import { APIGatewayEvent, Context, Callback } from 'aws-lambda';
import * as Jimp from 'jimp';
export async function resize(
event: APIGatewayEvent,
context: Context,
callback: Callback
) {
const image = await Jimp.read(event.queryStringParameters.src);
await image.cover(Number(event.queryStringParameters.w), Number(event.queryStringParameters.h));