mirror of https://gitlab.com/curben/blog
fix(cf-pages): service binding in wrangler.toml only applies to worker
This commit is contained in:
parent
5fbbd85b12
commit
3fc28281b2
|
@ -5,5 +5,8 @@ export async function onRequestGet(context) {
|
|||
// headers: context.request.headers
|
||||
// })
|
||||
// return fetch(imageRequest)
|
||||
|
||||
// CF_IMAGES binds to cf-images worker
|
||||
// configured in the pages dashboard
|
||||
return context.env.CF_IMAGES.fetch(context.request)
|
||||
}
|
||||
|
|
|
@ -4,10 +4,4 @@ compatibility_date = "2024-09-23"
|
|||
compatibility_flags = [ "nodejs_compat" ]
|
||||
send_metrics = false
|
||||
|
||||
# worker
|
||||
route = { pattern = "https://mdleom.com/images/*", zone_name = "mdleom.com" }
|
||||
|
||||
# pages function
|
||||
[[services]]
|
||||
binding = "CF_IMAGES"
|
||||
service = "cf-images"
|
||||
|
|
Loading…
Reference in New Issue