sladg / nextjs-lambda

Lambda deployments for Nextjs12 & Nextjs13 (standalone). Easy CLI commands to get your standalone Next output to run in AWS Lambda (not @Edge)! Uses CDK in behind and produces code zips importable to Terraform, Serverless, Azure, etc.
MIT License
169 stars 19 forks source link

Allow image lambda to fetch remote images #64

Closed sladg closed 1 year ago

sladg commented 1 year ago

Consider following scenario:

next.config.js allows us to specify domains allowed.

Image lambda should check if URL is absolute or relative. If relative, use internal S3 bucket, if absolute, fetch remote image.

sladg commented 1 year ago

As of version v4 handler can be used to fetch and optimise any image. Remote images as well as single S3 bucket origin are supported.