Skip to content

Commit 37fcce7

Browse files
authored
Tweak deployment instructions, add Now
1 parent f34c72e commit 37fcce7

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

template/README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ You can find the most recent version of this guide [here](https://github.com/fac
2020
- [Adding Flow](#adding-flow)
2121
- [Adding Custom Environment Variables](#adding-custom-environment-variables)
2222
- [Integrating with a Node Backend](#integrating-with-a-node-backend)
23-
- [Deploying](#deploying)
23+
- [Deployment](#deployment)
24+
- [Now](#now)
25+
- [Heroku](#heroku)
26+
- [GitHub Pages](#github-pages)
2427
- [Something Missing?](#something-missing)
2528

2629
## Updating to New Releases
@@ -459,7 +462,15 @@ if (process.env.NODE_ENV !== 'production') {
459462
460463
Check out [this tutorial](https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/) for instructions on integrating an app with a Node backend running on another port, and using `fetch()` to access it. You can find the companion GitHub repository [here](https://github.com/fullstackreact/food-lookup-demo).
461464
462-
## Deploying
465+
## Deployment
466+
467+
### Now
468+
469+
See [this example](https://github.com/xkawi/create-react-app-now) for a zero-configuration single-command deployment with [now](https://zeit.co/now).
470+
471+
### Heroku
472+
473+
Use the [Heroku Buildpack for create-react-app](https://github.com/mars/create-react-app-buildpack).
463474
464475
### GitHub Pages
465476
@@ -479,11 +490,12 @@ It could look like this:
479490
Now, whenever you run `npm run build`, you will see a cheat sheet with a sequence of commands to deploy to GitHub pages:
480491
481492
```sh
493+
git commit -am "Save local changes"
482494
git checkout -B gh-pages
483495
git add -f build
484496
git commit -am "Rebuild website"
485-
git push origin :gh-pages
486-
git subtree push --prefix build origin gh-pages
497+
git filter-branch -f --prune-empty --subdirectory-filter build
498+
git push -f origin gh-pages
487499
git checkout -
488500
```
489501
@@ -493,10 +505,6 @@ Note that GitHub Pages doesn't support routers that use the HTML5 `pushState` hi
493505
* 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.
494506
* 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).
495507

496-
### Heroku
497-
498-
Use the [Heroku Buildpack for create-react-app](https://github.com/mars/create-react-app-buildpack).
499-
500508
## Something Missing?
501509

502510
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)