title: How to use environment variables in CloudFlare Worker in local development environment
body: <p>I have a CloudFlare Worker where I have environment variables set in the CF Settings..Environment Variables interface. I also have this wrangler.toml</p>
  <p><a href="https://i.stack.imgur.com/Hp1ER.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Hp1ER.png" alt="my wrangler.toml" /></a></p>
  <p>In my worker's index.js I have code reading the variable REGISTRATION_API_URL. If the code is running in a deployed environment then it injects the value from the CF Settings into REGISTRATION_API_URL just fine.</p>
  <p>But if I run
  <code>wrangler dev</code>
  or
  <code>wrangler dev --env local</code>
  then REGISTRATION_API_URL is undefined.</p>
  <p>Originally I expected that the variable would be populated by the CF Settings values, but they aren't. So I tried the two vars setting in the wrangler.toml I show here but no difference. And I have spent a lot of time searching the docs and the greater web.</p>
  <p>Are environment variables supported in a local dev environment? Any workarounds that people have come up with? Currently I am looking for undefined and defining the variable with a hard-coded value, but this is not a great answer.</p>
  <p>Using wrangler 1.16.0</p>
  <p>Thanks.</p>