[TS] Passing object/data from CF Functions middleware to function handlers
I would like to setup Prisma in a functions
_middleware.ts
like:
I have a wrangler types functions/worker-configuration.d.ts
generated file that looks like:
In my function handler I would like to use prisma
client (type-safe) like:
How should I pass the prisma
client best? Via context.env
or context.data
?
And how to type it?0 Replies