service bindings does not work

Locally I can do
npm create cloudflare@latest -- web --type web-framework
npm create cloudflare@latest -- web --type web-framework
to create a website using qwik framework. I also have
[[services]]
binding = "SOMETHING"
service = "worker-something"
[[services]]
binding = "SOMETHING"
service = "worker-something"
in my wrangler.toml. In my index.ts I have
export const onRequest = async (context: any) => {
const result = await context.platform.env.TICKERS.fetch('...')
console.log({result})
}
export const onRequest = async (context: any) => {
const result = await context.platform.env.TICKERS.fetch('...')
console.log({result})
}
but I cannot seem to connect to the other worker as I always get 503. I wonder if anyone knows how to get around this.
1 Reply
jordanfinners
jordanfinners•6mo ago
I don't think you need the .platform unless you've modified what context looks like? 🤔
Want results from more Discord servers?
Add your server