Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
xesrevinu committed Oct 10, 2024
1 parent 531f4e0 commit 5de10c0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ const runtime = ManagedRuntime.make(Live)

const handler = HttpApiBuilder.toWebHandler(runtime, HttpMiddleware.logger)

declare global {
// eslint-disable-next-line no-var
var env: Env
}

export default {
fetch(request) {
fetch(request, env) {
Object.assign(globalThis, {
env
})

return handler(request as unknown as Request)
}
} satisfies ExportedHandler<Env>

0 comments on commit 5de10c0

Please sign in to comment.