You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 11, 2022. It is now read-only.
@@ -147,21 +153,30 @@ Prevent downgrade attacks with [HTTP strict transport security](https://develope
147
153
148
154
### Environment variables
149
155
150
-
[`REACT_APP_*`](https://github.com/facebookincubator/create-react-app/blob/v0.2.3/template/README.md#adding-custom-environment-variables) environment variable are supported with this buildpack.
156
+
[`REACT_APP_*` environment variables](https://github.com/facebookincubator/create-react-app/blob/v0.2.3/template/README.md#adding-custom-environment-variables) are supported with this buildpack.
151
157
152
158
🤐 *Be careful not to export secrets. These values may be accessed by anyone who can see the React app.*
153
159
154
-
Set [env vars on a Heroku app](https://devcenter.heroku.com/articles/config-vars) like this:
160
+
##### [Set vars on Heroku](https://devcenter.heroku.com/articles/config-vars)
155
161
156
162
```bash
157
163
heroku config:set REACT_APP_HELLO='I love sushi!'
158
164
```
159
165
160
-
For local development, use [dotenv](https://www.npmjs.com/package/dotenv) to load variables from a `.env` file. *Requires at least create-react-app 0.7.*
166
+
##### Set vars for local dev
167
+
168
+
*Requires at least create-react-app 0.7. Earlier versions only support Compile-time.*
169
+
170
+
Create a `.env` file that sets a variable per line:
171
+
172
+
```bash
173
+
REACT_APP_API_URL=http://api.example.com
174
+
REACT_APP_CLIENT_ID=XyzxYzxyZ
175
+
```
161
176
162
177
#### Compile-time vs Runtime
163
178
164
-
Two versions of variables are supported. In addition to compile-time variables applied during [build](https://github.com/facebookincubator/create-react-app#npm-run-build), this buildpack supports runtime configuration as well.
179
+
Two versions of variables are supported. In addition to compile-time variables applied during [build](https://github.com/facebookincubator/create-react-app#npm-run-build) the app supports variables set at runtime, applied as each web dyno starts-up.
0 commit comments