Skip to content

Commit 88ed883

Browse files
authored
Reorder deployment instructions by alphabet + minor tweaks
1 parent 10012f3 commit 88ed883

File tree

1 file changed

+41
-37
lines changed

1 file changed

+41
-37
lines changed

template/README.md

+41-37
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ You can find the most recent version of this guide [here](https://github.com/fac
3838
- [Disabling jsdom](#disabling-jsdom)
3939
- [Experimental Snapshot Testing](#experimental-snapshot-testing)
4040
- [Deployment](#deployment)
41-
- [Now](#now)
42-
- [Modulus](#modulus)
41+
- [Building for Relative Paths](#building-for-relative-paths)
42+
- [GitHub Pages](#github-pages)
4343
- [Heroku](#heroku)
44+
- [Modulus](#modulus)
45+
- [Now](#now)
4446
- [Surge](#surge)
45-
- [GitHub Pages](#github-pages)
4647
- [Something Missing?](#something-missing)
4748

4849
## Updating to New Releases
@@ -80,6 +81,7 @@ my-app/
8081
src/
8182
App.css
8283
App.js
84+
App.test.js
8385
index.css
8486
index.js
8587
logo.svg
@@ -743,6 +745,8 @@ This feature is experimental and still [has major usage issues](https://github.c
743745
744746
## Deployment
745747
748+
## Building for Relative Paths
749+
746750
By default, Create React App produces a build assuming your app is hosted at the server root.
747751
To override this, specify the `homepage` in your `package.json`, for example:
748752
@@ -752,40 +756,6 @@ To override this, specify the `homepage` in your `package.json`, for example:
752756
753757
This will let Create React App correctly infer the root path to use in the generated HTML file.
754758
755-
### Now
756-
757-
See [this example](https://github.com/xkawi/create-react-app-now) for a zero-configuration single-command deployment with [now](https://zeit.co/now).
758-
759-
### Modulus
760-
761-
See the [Modulus blog post](http://blog.modulus.io/deploying-react-apps-on-modulus) on how to deploy your react app to Modulus.
762-
763-
### Heroku
764-
765-
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).
766-
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
767-
768-
### Surge
769-
770-
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.
771-
772-
```sh
773-
email: email@domain.com
774-
password: ********
775-
project path: /path/to/project/build
776-
size: 7 files, 1.8 MB
777-
domain: create-react-app.surge.sh
778-
upload: [====================] 100%, eta: 0.0s
779-
propagate on CDN: [====================] 100%
780-
plan: Free
781-
users: email@domain.com
782-
IP Address: X.X.X.X
783-
784-
Success! Project is published and running at create-react-app.surge.sh
785-
```
786-
787-
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).
788-
789759
### GitHub Pages
790760
791761
>Note: this feature is available with `react-scripts@0.2.0` and higher.
@@ -817,6 +787,40 @@ Note that GitHub Pages doesn't support routers that use the HTML5 `pushState` hi
817787
* 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.
818788
* 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).
819789
790+
### Heroku
791+
792+
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).
793+
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
794+
795+
### Modulus
796+
797+
See the [Modulus blog post](http://blog.modulus.io/deploying-react-apps-on-modulus) on how to deploy your react app to Modulus.
798+
799+
### Now
800+
801+
See [this example](https://github.com/xkawi/create-react-app-now) for a zero-configuration single-command deployment with [now](https://zeit.co/now).
802+
803+
### Surge
804+
805+
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.
806+
807+
```sh
808+
email: email@domain.com
809+
password: ********
810+
project path: /path/to/project/build
811+
size: 7 files, 1.8 MB
812+
domain: create-react-app.surge.sh
813+
upload: [====================] 100%, eta: 0.0s
814+
propagate on CDN: [====================] 100%
815+
plan: Free
816+
users: email@domain.com
817+
IP Address: X.X.X.X
818+
819+
Success! Project is published and running at create-react-app.surge.sh
820+
```
821+
822+
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).
823+
820824
## Something Missing?
821825
822826
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 commit comments

Comments
 (0)