diff --git a/lib/templates/imageFunction.js b/lib/templates/imageFunction.js index 9e74447..60b84c4 100644 --- a/lib/templates/imageFunction.js +++ b/lib/templates/imageFunction.js @@ -7,7 +7,7 @@ exports.handler = async (event) => { const quality = parseInt(q); const imageUrl = url.startsWith("/") - ? `${process.env.URL || "http://localhost:8888"}${url}` + ? `${process.env.DEPLOY_URL || `http://${event.headers.host}`}${url}` : url; const image = await jimp.read(imageUrl);