cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.53k stars 647 forks source link

🚀 Feature Request: Load dev https certificate and key from environment variables #5997

Closed kansson closed 1 week ago

kansson commented 2 months ago

Describe the solution

I use Tailscale for https during development and have a common certificate and key for all projects. It would be convenient to load these using environment variables like WRANGLER_HTTPS_{CERT|_KEY}_PATH.

petebacondarwin commented 2 months ago

We discussed this in https://github.com/cloudflare/workers-sdk/pull/4475#issuecomment-1835987149. It was decided, at that time, that it was more flexible to use a command line argument. But we could consider ENV vars too?? Would the CLI args approach be enough for you?

kansson commented 2 months ago

But we could consider ENV vars too?? Would the CLI args approach be enough for you?

Command line arguments works fine but environment variables would be far more convenient. Also with the latter you don't need to add args to the package.json script and potentiality break for other users who don't have the certificate and key. Maybe these options also can be added to the dev section in the wrangler config?