unenv
unenv copied to clipboard
Accessing CallContext from handlers
CallContext, which is the argument of the handler created by createCall, can have additional properties, but those properties are not passed to the actual handler (such as h3 app) and are not accessible.
Cloudflare Workers, for example, may need access to event and I want a way to access this.
https://github.com/unjs/nitro/blob/v0.4.4/src/runtime/entries/cloudflare.ts#L26
One suggested solution is to add context prop to req.
(req as any)._callContext = context, or (req as any)[symCallContext] = context (using symbol)
May not needed when unjs/h3#73 is done.