Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs re production builds #1316

Merged
merged 1 commit into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -136,15 +136,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 @@ -153,3 +156,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/
```