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.
Copy file name to clipboardExpand all lines: README.md
+50-6Lines changed: 50 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,27 @@
1
1
Heroku Buildpack for create-react-app
2
2
=====================================
3
3
4
-
Deploy React.js web apps generated with [create-react-app](https://github.com/facebookincubator/create-react-app).
4
+
Deploy React.js web apps generated with [create-react-app](https://github.com/facebookincubator/create-react-app). Automates deployment with the built-in bundler and serves it up via [Nginx](http://nginx.org/en/). See the [introductory blog post](https://blog.heroku.com/deploying-react-with-zero-configuration) and entry in [Heroku elements](https://elements.heroku.com/buildpacks/mars/create-react-app-buildpack).
> Automates deployment with the built-in tooling and serves it up via [Nginx](http://nginx.org/en/).
24
+
-----
7
25
8
26
Requires
9
27
--------
@@ -106,6 +124,30 @@ Create a `static.json` file to configure the web server for clean [`browserHisto
106
124
}
107
125
```
108
126
127
+
#### HTTPS-only
128
+
129
+
Enforce secure connections by automatically redirecting insecure requests to `https://`:
130
+
131
+
```json
132
+
{
133
+
"https_only": true
134
+
}
135
+
```
136
+
137
+
Prevent downgrade attacks by adding an HSTS header, [HTTP strict transport security](https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security):
138
+
139
+
```json
140
+
{
141
+
"headers": {
142
+
"/**": {
143
+
"Strict-Transport-Security": "max-age=7776000"
144
+
}
145
+
}
146
+
}
147
+
```
148
+
149
+
*`max-age` is the number of seconds to enforce HTTPS since the last connection; the example is 90-days
150
+
109
151
### Environment variables
110
152
111
153
[`REACT_APP_*`](https://github.com/facebookincubator/create-react-app/blob/v0.2.3/template/README.md#adding-custom-environment-variables) and [`NODE_*`](https://github.com/facebookincubator/create-react-app/pull/476) environment variables are supported on Heroku during the compile phase, when `npm run build` is executed to generate the JavaScript bundle.
@@ -126,15 +168,17 @@ git push heroku master
126
168
Version compatibility
127
169
---------------------
128
170
129
-
We'll keep branches to maintain compatibility as `create-react-app` evolves. These will only be useful for projects that have been ejected and therefore stagnate with the tooling of a specific version.
171
+
This buildpack will never intentionally cause previously deployed apps to become undeployable. Usually, using master [as directed in the main instructions](#create-the-heroku-app) will automatically deploy an app with the most recent version of this buildpack.
130
172
131
-
Currently, using branch `cra-0.2.x` will ensure that your deployment continues to work with 0.2.x versions of `create-react-app`.
173
+
[Releases are tagged](https://github.com/mars/create-react-app-buildpack/releases), so you can lock your deployment to a specific version, if that kind of stability pleases you:
Usually, using master [as directed in the main instructions](#create-the-heroku-app) will be appropriate to automatically keep up with the newest `create-react-app`.
179
+
✏️ *Replace `v1.2.1` with the desired [release tag](https://github.com/mars/create-react-app-buildpack/releases).*
180
+
181
+
♻️ Then, commit & deploy to rebuild on the new buildpack version.
0 commit comments