Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2124fbe

Browse filesBrowse files
committed
Tweak deployment instructions, add Now
1 parent 43dfc48 commit 2124fbe
Copy full SHA for 2124fbe

File tree

Expand file treeCollapse file tree

1 file changed

+16
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-8
lines changed

‎template/README.md

Copy file name to clipboardExpand all lines: template/README.md
+16-8Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ You can find the most recent version of this guide [here](https://github.com/fac
1919
- [Adding Bootstrap](#adding-bootstrap)
2020
- [Adding Flow](#adding-flow)
2121
- [Integrating with a Node Backend](#integrating-with-a-node-backend)
22-
- [Deploying](#deploying)
22+
- [Deployment](#deployment)
23+
- [Now](#now)
24+
- [Heroku](#heroku)
25+
- [GitHub Pages](#github-pages)
2326
- [Something Missing?](#something-missing)
2427

2528
## Updating to New Releases
@@ -387,7 +390,15 @@ We will consider integrating more tightly with Flow in the future so that you do
387390
388391
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).
389392
390-
## Deploying
393+
## Deployment
394+
395+
### Now
396+
397+
See [this example](https://github.com/xkawi/create-react-app-now) for a zero-configuration single-command deployment with [now](https://zeit.co/now).
398+
399+
### Heroku
400+
401+
Use the [Heroku Buildpack for create-react-app](https://github.com/mars/create-react-app-buildpack).
391402
392403
### GitHub Pages
393404
@@ -407,11 +418,12 @@ It could look like this:
407418
Now, whenever you run `npm run build`, you will see a cheat sheet with a sequence of commands to deploy to GitHub pages:
408419
409420
```sh
421+
git commit -am "Save local changes"
410422
git checkout -B gh-pages
411423
git add -f build
412424
git commit -am "Rebuild website"
413-
git push origin :gh-pages
414-
git subtree push --prefix build origin gh-pages
425+
git filter-branch -f --prune-empty --subdirectory-filter build
426+
git push -f origin gh-pages
415427
git checkout -
416428
```
417429
@@ -421,10 +433,6 @@ Note that GitHub Pages doesn't support routers that use the HTML5 `pushState` hi
421433
* 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.
422434
* 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).
423435

424-
### Heroku
425-
426-
Use the [Heroku Buildpack for create-react-app](https://github.com/mars/create-react-app-buildpack).
427-
428436
## Something Missing?
429437

430438
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.