-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(guides/envvars): clarify docs for local/production env variables #3368
Conversation
@dgurns Thank you for opening this PR ! This seems a little too specific to me, and perhaps should be added in a new, CF specific, section. @kentcdodds WDYT? |
|
||
{ | ||
"scripts": { | ||
"dev:wrangler": "cross-env NODE_ENV=development wrangler pages dev ./public --binding $(cat .env)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha, I didn't even think to cat the env file, I've been binding these values individually (like a fool)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gotta give a h/t to @theeomm on that one! #3186 (comment)
Just threw some minor thoughts up, take or leave my opinions if you choose to use any of this. ❤️ |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Thanks for the great feedback folks. I updated the doc to be better organized, dividing "Server Environment Variables" into "Local Development" and "Production" sections. |
That PR looks great and will help, but I think this one is important as well. If you're a new user with a Cloudflare Pages project:
|
I think it is necessary for this PR to be merged too as it really documents how to handle environment variables with CF, which I should have probably done in my PR in the first place. |
Thanks everyone! |
Cool! Gotta say I am super impressed with the Remix community so far. Thank you all for jumping in with feedback so quickly on the PR, and seeing it merged in a few days. Amazing stuff! Excited to keep digging in to Remix. |
When I recently spun up a project using the
@remix-run/cloudflare-pages
adapter, it was not clear how to set up and use env variables, both locally and when deployed to Cloudflare Pages.Thankfully @jemjam figured it out in this issue comment
This updates the Environment Variables docs with that information. This should hopefully save people a lot of pain when initially setting up a new project with the Cloudflare Pages adapter.