You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Cloudflare Worker, we can set environment variables in wrangler.toml, but I found that it's not accessible when we use Hono in Service Worker mode (app.fire()).
Hi!
I want to have this feature, too. I thought about how to implement it, but I could not find a good way. In Service Worker mode, Environment variables are bound into global variables. In Context, we can bind the variables intoc.env like this:
this.env.API_KEY=globalThis.API_KEY
but we can not know which key to bind. Um-hum. I think using Module Worker mode is better.
Although It's still difficult to bind into c.env. in Service Worker mode, I've implemented a new feature about c.env for Module Worker. See #191 Now, c.env has types.
In Cloudflare Worker, we can set environment variables in wrangler.toml, but I found that it's not accessible when we use Hono in Service Worker mode (
app.fire()
).Module Worker mode like following works well.
I am thinking if we can make environment variables works in
app.fire()
, it'd be great.The text was updated successfully, but these errors were encountered: