Skip to content

Commit

Permalink
Update docs re production builds (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow authored Dec 5, 2017
1 parent 9882a44 commit 342e71e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Development
6. Open `http://[::]:8080/` to view the home page.

To generate the frontend using production cache settings – that is,
badge preview URIs with `maxAge` – run `npm run build:production`.
badge preview URIs with `maxAge` – run `LONG_CACHE=true npm run build`.

To analyze the frontend bundle, run `npm install webpack-bundle-analyzer` and
then `ANALYZE=true npm start`.
Expand Down
20 changes: 15 additions & 5 deletions doc/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Build the frontend
------------------

```sh
BASE_URL=https://your-server.example.com npm run build:production
LONG_CACHE=true npm run build
```


Expand Down Expand Up @@ -147,15 +147,18 @@ Separate frontend hosting
-------------------------

If you want to host the frontend on a separate server, such as cloud storage
or a CDN, you can do that. Just copy the built `index.html` there.
or a CDN, you can do that.

To help out users, you can make the Shields server redirect the server root.
Set the `REDIRECT_URI` environment variable:
First, build the frontend, pointing `BASE_URL` to your server.

```sh
REDIRECT_URI=http://my-custom-shields.s3.amazonaws.com/
LONG_CACHE=true BASE_URL=https://your-server.example.com npm run build
```

Then copy the contents of the `build/` folder to your static hosting / CDN.

There are also a couple settings you should configure on the server.

If you want to use server suggestions, you should also set `ALLOWED_ORIGIN`:

```sh
Expand All @@ -164,3 +167,10 @@ ALLOWED_ORIGIN=http://my-custom-shields.s3.amazonaws.com,https://my-custom-shiel

This should be a comma-separated list of allowed origin headers. They should
not have paths or trailing slashes.

To help out users, you can make the Shields server redirect the server root.
Set the `REDIRECT_URI` environment variable:

```sh
REDIRECT_URI=http://my-custom-shields.s3.amazonaws.com/
```

0 comments on commit 342e71e

Please sign in to comment.