Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
馃摎 doc Routing with clean URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mars committed Aug 1, 2016
1 parent 06346ab commit 6dad58d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,27 @@ Customization

The web server may be [configured via the static buildpack](https://github.com/heroku/heroku-buildpack-static#configuration).

The default config, if `static.json` does not already exist, is:
The default `static.json`, if it does not exist in the repo, is:

```json
{ "root": "build/" }
```

### Router Push State
### Routing clean URLs

To support clean URLs with React Router (not included), configure with [HTML5 Push State](https://gist.github.com/hone/24b06869b4c1eca701f9#html5-push-state) from **Getting Started with Single Page Apps on Heroku**.
By default, [React Router](https://github.com/reactjs/react-router) (not included) uses hash-based URLs like `https://example.com/index.html#/users/me/edit`. This is nice & easy when getting started with local development, but for a public app you probably want real URLs like `https://example.com/users/me/edit`.

Create a `static.json` file to configure the web server for clean [`browserHistory` URLs with React Router](https://github.com/reactjs/react-router/blob/master/docs/guides/Histories.md#browserhistory):

```json
{
"root": "build/",
"clean_urls": false,
"routes": {
"/**": "index.html"
}
}
```


Architecture 馃彊
Expand Down

0 comments on commit 6dad58d

Please sign in to comment.