Skip to content

Commit

Permalink
Reorder deployment instructions by alphabet + minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Sep 2, 2016
1 parent 10012f3 commit 88ed883
Showing 1 changed file with 41 additions and 37 deletions.
78 changes: 41 additions & 37 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ You can find the most recent version of this guide [here](https://github.com/fac
- [Disabling jsdom](#disabling-jsdom)
- [Experimental Snapshot Testing](#experimental-snapshot-testing)
- [Deployment](#deployment)
- [Now](#now)
- [Modulus](#modulus)
- [Building for Relative Paths](#building-for-relative-paths)
- [GitHub Pages](#github-pages)
- [Heroku](#heroku)
- [Modulus](#modulus)
- [Now](#now)
- [Surge](#surge)
- [GitHub Pages](#github-pages)
- [Something Missing?](#something-missing)

## Updating to New Releases
Expand Down Expand Up @@ -80,6 +81,7 @@ my-app/
src/
App.css
App.js
App.test.js
index.css
index.js
logo.svg
Expand Down Expand Up @@ -743,6 +745,8 @@ This feature is experimental and still [has major usage issues](https://github.c
## Deployment
## Building for Relative Paths
By default, Create React App produces a build assuming your app is hosted at the server root.
To override this, specify the `homepage` in your `package.json`, for example:
Expand All @@ -752,40 +756,6 @@ To override this, specify the `homepage` in your `package.json`, for example:
This will let Create React App correctly infer the root path to use in the generated HTML file.
### Now
See [this example](https://github.com/xkawi/create-react-app-now) for a zero-configuration single-command deployment with [now](https://zeit.co/now).
### Modulus
See the [Modulus blog post](http://blog.modulus.io/deploying-react-apps-on-modulus) on how to deploy your react app to Modulus.
### Heroku
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
### Surge
Install the Surge CLI if you haven't already by running `npm install -g surge`. Run the `surge` command and log in you or create a new account. You just need to specify the *build* folder and your custom domain, and you are done.
```sh
email: email@domain.com
password: ********
project path: /path/to/project/build
size: 7 files, 1.8 MB
domain: create-react-app.surge.sh
upload: [====================] 100%, eta: 0.0s
propagate on CDN: [====================] 100%
plan: Free
users: email@domain.com
IP Address: X.X.X.X
Success! Project is published and running at create-react-app.surge.sh
```
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).
### GitHub Pages
>Note: this feature is available with `react-scripts@0.2.0` and higher.
Expand Down Expand Up @@ -817,6 +787,40 @@ Note that GitHub Pages doesn't support routers that use the HTML5 `pushState` hi
* You could switch from using HTML5 history API to routing with hashes. If you use React Router, you can switch to `hashHistory` for this effect, but the URL will be longer and more verbose (for example, `http://user.github.io/todomvc/#/todos/42?_k=yknaj`). [Read more](https://github.com/reactjs/react-router/blob/master/docs/guides/Histories.md#histories) about different history implementations in React Router.
* Alternatively, you can use a trick to teach GitHub Pages to handle 404 by redirecting to your `index.html` page with a special redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages).
### Heroku
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
### Modulus
See the [Modulus blog post](http://blog.modulus.io/deploying-react-apps-on-modulus) on how to deploy your react app to Modulus.
### Now
See [this example](https://github.com/xkawi/create-react-app-now) for a zero-configuration single-command deployment with [now](https://zeit.co/now).
### Surge
Install the Surge CLI if you haven't already by running `npm install -g surge`. Run the `surge` command and log in you or create a new account. You just need to specify the *build* folder and your custom domain, and you are done.
```sh
email: email@domain.com
password: ********
project path: /path/to/project/build
size: 7 files, 1.8 MB
domain: create-react-app.surge.sh
upload: [====================] 100%, eta: 0.0s
propagate on CDN: [====================] 100%
plan: Free
users: email@domain.com
IP Address: X.X.X.X
Success! Project is published and running at create-react-app.surge.sh
```
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).
## Something Missing?
If you have ideas for more “How To” recipes that should be on this page, [let us know](https://github.com/facebookincubator/create-react-app/issues) or [contribute some!](https://github.com/facebookincubator/create-react-app/edit/master/template/README.md)

0 comments on commit 88ed883

Please sign in to comment.