This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plugins: | |
| - serverless-apigw-binary | |
| custom: | |
| apigwBinary: | |
| types: | |
| - 'image/jpeg' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)); |
NewerOlder