stormcph
stormcph
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
i tried doing it like this, also note that the "variable" is just a placeholder for the actual names of the variable
const VARIABLE = self['VARIABLE'];
const VARIABLE = self['VARIABLE'];
also there are multiple but for this example we only ned to display one
14 replies
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
deployed
14 replies
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
No description
14 replies
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
No description
14 replies
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
um, i only have the worker.js (im working within the web browser editor with the cloudflare worker)
14 replies
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
where i try to define the variables within my worker.js
14 replies
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
okay, please dont judge the code i made, it may look stupid in your eyes...
export default {
async fetch(request, env, context) {
const {
ENV_SERVICE_ACCOUNT_EMAIL: SERVICE_ACCOUNT_EMAIL,
ENV_PRIVATE_KEY_PEM: PRIVATE_KEY_PEM,
ENV_TOKEN_URL: TOKEN_URL,
ENV_SHEET_ID: SHEET_ID,
ENV_RANGE: RANGE,
ENV_SERVER_HASH: SERVER_HASH
} = env;
export default {
async fetch(request, env, context) {
const {
ENV_SERVICE_ACCOUNT_EMAIL: SERVICE_ACCOUNT_EMAIL,
ENV_PRIVATE_KEY_PEM: PRIVATE_KEY_PEM,
ENV_TOKEN_URL: TOKEN_URL,
ENV_SHEET_ID: SHEET_ID,
ENV_RANGE: RANGE,
ENV_SERVER_HASH: SERVER_HASH
} = env;
that was just a small snippet of my code
14 replies
CDCloudflare Developers
Created by stormcph on 9/20/2023 in #workers-help
worker environment variables, please help :)
um as i said, im pretty new to it. so im not completely sure, i'm diong it like its saying in the doc
14 replies