blog/functions/images/[[catchall]].js

13 lines
428 B
JavaScript
Raw Normal View History

2024-10-06 20:06:16 +00:00
export async function onRequestGet(context) {
// const {pathname} = new URL(context.request.url)
// const imageURL = new URL(pathname, 'https://mdleom.com')
// const imageRequest = new Request(imageURL, {
// headers: context.request.headers
// })
// return fetch(imageRequest)
// CF_IMAGES binds to cf-images worker
// configured in the pages dashboard
2024-10-06 20:06:16 +00:00
return context.env.CF_IMAGES.fetch(context.request)
}