Paulo S Klaus
Paulo S Klaus
CDCloudflare Developers
Created by Paulo S Klaus on 4/4/2025 in #workers-help
Avoid hardcoded IDs in the repository
@Walshy, I will use the approach suggested by @texan, but if you have any other ideas or different viewpoints, they are always welcome!
7 replies
CDCloudflare Developers
Created by Paulo S Klaus on 4/4/2025 in #workers-help
Avoid hardcoded IDs in the repository
The issue is simply to separate what is configuration from the codebase. For example, if I want or need to deploy the same project pointing to another instance of D1, I can do this by just defining an environment variable, without having to change the code or even clone the project to avoid making changes in the first environment that is already live. But maybe it's just an excess of caution from having faced challenges for so many decades as a programmer.
7 replies
CDCloudflare Developers
Created by Paulo S Klaus on 4/4/2025 in #workers-help
Avoid hardcoded IDs in the repository
I am using the deployment process of the worker through Cloudflare itself. In this case, I think I will create a custom script (something like npm run worker:deploy) that creates or modifies a wrangler.build.jsonc by taking environment variables and then executes the wrangler deploy using the file I created. Thank you very much for the response, Will.
7 replies