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
-[Building for Relative Paths](#building-for-relative-paths)
42
+
-[GitHub Pages](#github-pages)
43
43
-[Heroku](#heroku)
44
+
-[Modulus](#modulus)
45
+
-[Now](#now)
44
46
-[Surge](#surge)
45
-
-[GitHub Pages](#github-pages)
46
47
-[Something Missing?](#something-missing)
47
48
48
49
## Updating to New Releases
@@ -80,6 +81,7 @@ my-app/
80
81
src/
81
82
App.css
82
83
App.js
84
+
App.test.js
83
85
index.css
84
86
index.js
85
87
logo.svg
@@ -743,6 +745,8 @@ This feature is experimental and still [has major usage issues](https://github.c
743
745
744
746
## Deployment
745
747
748
+
## Building for Relative Paths
749
+
746
750
By default, Create React App produces a build assuming your app is hosted at the server root.
747
751
To override this, specify the `homepage` in your `package.json`, for example:
748
752
@@ -752,40 +756,6 @@ To override this, specify the `homepage` in your `package.json`, for example:
752
756
753
757
This will let Create React App correctly infer the root path to use in the generated HTML file.
754
758
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
-
789
759
### GitHub Pages
790
760
791
761
>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
817
787
* 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.
818
788
* 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).
819
789
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
+
820
824
## Something Missing?
821
825
822
826
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