Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91e4d16

Browse files
authored
📚 integrated docs for Runtime Env
1 parentcae09e0 commit91e4d16

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

‎README.md‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Deploy React.js web apps generated with [create-react-app](https://github.com/fa
1515
*[Routing clean URLs](#routing-clean-urls)
1616
*[HTTPS-only](#https-only)
1717
*[Environment variables](#environment-variables)
18+
*[Set vars on Heroku](#set-vars-on-heroku)
19+
*[Set vars for local dev](#set-vars-for-local-dev)
20+
*[Compile-time vs Runtime](#compile-time-vs-runtime)
21+
*[Compile-time config](#compile-time-configuration)
22+
*[Runtime config](#runtime-configuration)
23+
*[using an Add-on's config](#add-on-config-vars)
1824
* 📍[Version compatibility](#version-compatibility)
1925
* 🏙[Architecture](#architecture-)
2026

@@ -147,21 +153,30 @@ Prevent downgrade attacks with [HTTP strict transport security](https://develope
147153

148154
###Environment variables
149155

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.
151157

152158
🤐*Be careful not to export secrets. These values may be accessed by anyone who can see the React app.*
153159

154-
Set[env vars onaHeroku app](https://devcenter.heroku.com/articles/config-vars) like this:
160+
#####[Set vars on Heroku](https://devcenter.heroku.com/articles/config-vars)
155161

156162
```bash
157163
heroku config:set REACT_APP_HELLO='I love sushi!'
158164
```
159165

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+
```
161176

162177
####Compile-time vs Runtime
163178

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 aswell.
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 supportsvariables set atruntime, applied aseach web dyno starts-up.
165180

166181
Requirement |[Compile-time](#compile-time-configuration) |[Runtime](#runtime-configuration)
167182
:--- |:---:|:---:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp