I’m not able to bind services via wrangler.
If I create a binding via the UI, it works fine and I’m able to make a fetch call like this:
/* global API, FORMDATA_SERVICE_KEY */
await API.fetch(new Request(uri, {
method: 'GET',
headers: { 'Authorization': SERVICE_KEY}
}))
API
is the name of the binding.
However, once I publish the worker via wrangler, this binding is deleted.
I’ve tried setting up the binding in wrangler.toml like this (spec here)
[[services]]
binding = "API"
service = "api"
environment = "production"
and also like this (mentioned here)
services = [
{ binding = "API", service = "api", environment = "production" }
]
Any clue?