flow
CDCloudflare Developers
•Created by flow on 4/26/2024 in #workers-help
Service pattern with Hono.js
Hey Im coming from Expressjs backend dev background, and its a bit confusing to me how to implement service pattern with Hono js on top of Cloudflare workers.
What i want to achieve is create a singleton object of thirdparty SDK service in
/services/engine.ts
file.
And then inside hono routes use it like this:
How can I achieve this? Im getting error inside engine.ts
file, since it cannot access env vars for some reason.28 replies