A simple way to read from wrangler.toml

hello n.n , Im new working with cloudflare and I trying to understand how the wrangler.toml works, so I want to make a simple worker taht redirect to the google page but reading the url from the wrangler.toml file using typescript in my local machine, I have tried several ways but I still dont get it, thanks in advance
4 Replies
c3men50n
c3men50n16mo ago
you want to be accessing the URL in your wrangler.toml via the environment variable
c3men50n
c3men50n16mo ago
Environment variables · Cloudflare Workers docs
Attach secrets, text strings, and JSON values as environment variables to your Worker. Environment variables are available on the env parameter passed …
Antony Jimenez
Antony JimenezOP16mo ago
im trying the example code and its throwing me this error
No description
No description
No description
Antony Jimenez
Antony JimenezOP16mo ago
nevermind i get it, missing the return response statement
Want results from more Discord servers?
Add your server