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

Commit56c8542

Browse files
authored
📚 doc HTTPS-only; add table of contents
1 parentf77861d commit56c8542

File tree

1 file changed

+50
-6
lines changed

1 file changed

+50
-6
lines changed

‎README.md‎

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
Heroku Buildpack for create-react-app
22
=====================================
33

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).
5+
6+
Table of contents
7+
-----------------
8+
9+
* ⚠️[Requirements](#requires)
10+
* 🚀[Usage](#usage)
11+
1.[Generate a React app](#generate-a-react-app)
12+
1.[Make it a git repo](#make-it-a-git-repo)
13+
1.[Create the Heroku app](#create-the-heroku-app)
14+
1.[Commit & deploy ♻️](#commit--deploy-️)
15+
1.[Continue Development](#continue-development)
16+
* 👓[Customization](#customization)
17+
*[Web server](#web-server)
18+
*[Routing clean URLs](#routing-clean-urls)
19+
*[HTTPS-only](#https-only)
20+
*[Environment variables](#environment-variables)
21+
* 📍[Version compatibility](#version-compatibility)
22+
* 🏙[Architecture](#architecture-)
523

6-
>Automates deployment with the built-in tooling and serves it up via[Nginx](http://nginx.org/en/).
24+
-----
725

826
Requires
927
--------
@@ -106,6 +124,30 @@ Create a `static.json` file to configure the web server for clean [`browserHisto
106124
}
107125
```
108126

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+
109151
###Environment variables
110152

111153
[`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
126168
Version compatibility
127169
---------------------
128170

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 thetooling 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 themost recent version of this buildpack.
130172

131-
Currently, using branch`cra-0.2.x` will ensure thatyour deploymentcontinuestowork with 0.2.x versionsof`create-react-app`.
173+
[Releases are tagged](https://github.com/mars/create-react-app-buildpack/releases), so you can lockyour deployment toa specific version, if that kindofstability pleases you:
132174

133175
```bash
134-
herokucreate -bhttps://github.com/mars/create-react-app-buildpack.git#cra-0.2.x
176+
herokubuildpacks:sethttps://github.com/mars/create-react-app-buildpack.git#v1.2.1
135177
```
136178

137-
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.
138182

139183

140184
Architecture 🏙

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp