Replies: 2 comments
-
Just ran into the same question. I'm using |
Beta Was this translation helpful? Give feedback.
-
Nothing to add on the description of the problem. Just vouching for the use case: I'm using the same setup (astro passing the request onto Hono) and bumped into the same thing. I'm using Astro in cloudflare pages and set it up this way to keep my API in the same worker. There's a stack of 'stuff' I'd like to pass on and bindings feels semantically odd as a place to store it. |
Beta Was this translation helpful? Give feedback.
-
I'm using Hono as a router and RPC client in my Astro app. I'm trying to figure out if there's a way to set variables with the .fetch function. I have middleware on the Astro side handling authorization, so I want to pass user and session objects to Hono when making a request. But it looks like fetch only takes bindings as the second parameter.
I tried passing
user
andsession
as Bindings, which works, but they don’t seem ideal for data specific to each request. The ultimate fix might be to create Hono middleware and skip using Astro locals, which I’ll probably do, but I’d still like to know if there’s a way to achieve this directly.Beta Was this translation helpful? Give feedback.
All reactions