Skip to content

Commit

Permalink
readme: Add Advanced Configuration (facebook#1515)
Browse files Browse the repository at this point in the history
* Add Advanced Configuration section

* Reference package.json instead

* Add HOST, HTTPS, and CI

* Switch wording from Amazon to a CDN

* Add test runner comment

* Add top-level README link

* Simplify wording

* Link to relevant docs

* Link to apps

* Add .env link

* Simpler links

* Add a CI flag note
  • Loading branch information
Timer authored Feb 10, 2017
1 parent 297377e commit 6cf0b5f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
- [Now](#now)
- [S3 and CloudFront](#s3-and-cloudfront)
- [Surge](#surge)
- [Advanced Configuration](#advanced-configuration)
- [Troubleshooting](#troubleshooting)
- [`npm start` doesn’t detect changes](#npm-start-doesnt-detect-changes)
- [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
Expand Down Expand Up @@ -1289,6 +1290,19 @@ Install the Surge CLI if you haven't already by running `npm install -g surge`.
Note that in order to support routers that use HTML5 `pushState` API, you may want to rename the `index.html` in your build folder to `200.html` before deploying to Surge. This [ensures that every URL falls back to that file](https://surge.sh/help/adding-a-200-page-for-client-side-routing).
## Advanced Configuration
You can adjust various development and production settings by setting environment variables in your shell or with [.env](#adding-development-environment-variables-in-env).
Variable | Development | Production | Usage
:--- | :---: | :---: | :---
BROWSER | :white_check_mark: | :x: | By default, Create React App will open the default system browser, favoring Chrome on macOS. Specify a [browser](https://github.com/sindresorhus/opn#app) to override this behavior, or set it to `none` to disable it completely.
HOST | :white_check_mark: | :x: | By default, the development web server binds to `localhost`. You may use this variable to specify a different host.
PORT | :white_check_mark: | :x: | By default, the development web server will attempt to listen on port 3000 or prompt you to attempt the next available port. You may use this variable to specify a different port.
HTTPS | :white_check_mark: | :x: | When set to `true`, Create React App will run the development server in `https` mode.
PUBLIC_URL | :x: | :white_check_mark: | Create React App assumes your application is hosted at the serving web server's root or a subpath as specified in [`package.json` (`homepage`)](#building-for-relative-paths). Normally, Create React App ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application.
CI | :large_orange_diamond: | :white_check_mark: | When set to `true`, Create React App treats warnings as failures in the build. It also makes the test runner non-watching. Most CIs set this flag by default.

## Troubleshooting

### `npm start` doesn’t detect changes
Expand Down

0 comments on commit 6cf0b5f

Please sign in to comment.