decryptedchaos
CDCloudflare Developers
•Created by decryptedchaos on 2/28/2025 in #workers-help
Is it possible to run a REST API with a worker?
I've been trying to build a fairly basic API on a worker using the Hono framework.
But I've been hitting wall after wall, mostly with the fact that workers (wrangler) do not work with standard node env variables. I've read the documentation on worker Environment Variables at least 10 time.. but for whatever reason the context of my app design just wont play nice with this way of passing envars Here's My entry point And here's a module that handles connecting to the database Am i just chasing my tail for no reason here? is this something explicitly disabled or prevented on workers? Am i misunderstanding the usecase? would this be better suited on pages? or is this just not something CF intends us to use at all?
But I've been hitting wall after wall, mostly with the fact that workers (wrangler) do not work with standard node env variables. I've read the documentation on worker Environment Variables at least 10 time.. but for whatever reason the context of my app design just wont play nice with this way of passing envars Here's My entry point And here's a module that handles connecting to the database Am i just chasing my tail for no reason here? is this something explicitly disabled or prevented on workers? Am i misunderstanding the usecase? would this be better suited on pages? or is this just not something CF intends us to use at all?
5 replies