Skip to content

Commit

Permalink
Use BACKEND_API_URL env var for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
larixer committed Jun 17, 2019
1 parent 89657da commit b3513ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
9 changes: 0 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,3 @@ os:
- linux
script:
- yarn test
before_deploy:
- rm -rf node_modules
deploy:
provider: heroku
api_key:
secure: sIe+wFvt7N8njuB8xtZzgFOZzla9UmlIz+0h84JRGyG4kE8VqIiqRlU3lXwGBWEIoKsIEIX4o3EHsRVIRplxw8oMRrfokwxQ9ZUtQP24MTJ4bevT8ypvhulEhUYGNtO16rFze8aslxaUlJUKz6ewHawK0ytpJQBMXfoeQuWVXOK6cv3Wa2ZG8D7WSoKEPtj6ZYhI180lcN0RP0+m+uOEPvhAvRStfyjPwmuQDp/aVnTlO/mhmOG/FVzAjeugyAwGEil9Ah5/fikkxy8dajGCU1O7YmgasnOrAuuDLno9ue1WOi0squzVqHgmkrTMJ1ckRml+MYH0q5SQSzGyigmSzeT9vg1jKrw0eMQxOArvu68KHWwcYn7cd9BkBWk+o43xuooAxsY3r98n0UHl2dxLd94ZngWNb/rWFFDEzDm417ltNXctdefbX9z64yl75IO/AMaXeiAzp9Gh+puz2UN+9+wRVAC2oZ6ITYIxjDKridmsyMWxURzgkatDAQupy9PaOG8AJSuDQMgTTyEXPYr+uWxVSioEODpOmO6hS4UiQ/TEa/yt/eB6tZVCiUY0waxx7sfF9DiaaF/U9W4HLHqTvMN6AOcWQJjMcemTvyH75xMN/n4Fc2xAT54ky7EvT6WyQMceNrCiAN6rghhkrOM5x4nHHGUokf63N4mTCtzjytQ=
app: apollo-universal-starter-kit
on:
repo: sysgears/apollo-universal-starter-kit
4 changes: 2 additions & 2 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ git merge upstream/stable

## How do I use a custom GraphQL back end?

To set your custom GraphQL back end endpoint, set `API_URL` environment variable or change URL in `packages/server/build.config.js` for the `__API_URL__` property:
To set your custom GraphQL back end endpoint, set `BACKEND_API_URL` environment variable or change URL in `packages/server/build.config.js` for the `__API_URL__` property:

```javascript
__API_URL__: process.env.API_URL || '/graphql', // set the full URL to the external GraphQL API e.g. https://
__API_URL__: process.env.BACKEND_API_URL || 'https://my-custom-domain/graphql', // set the full URL to the external GraphQL API e.g. https://
```

We recommend that you still run the back-end code provided by the starter kit to use the server-side rendering (SSR).
Expand Down
6 changes: 2 additions & 4 deletions packages/server/build.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const path = require('path');

const config = {
...require('../../build.config'),
__CLIENT__: false,
Expand All @@ -8,10 +6,10 @@ const config = {
__TEST__: false,
'process.env.NODE_ENV': process.env.NODE_ENV || 'development',
__SERVER_PORT__: process.env.SERVER_PORT || process.env.PORT || 8080,
__API_URL__: process.env.API_URL || '/graphql',
__API_URL__: process.env.BACKEND_API_URL || '/graphql',
__WEBSITE_URL__: process.env.WEBSITE_URL || 'http://localhost:3000',
__CDN_URL__: process.env.CDN_URL || '',
__FRONTEND_BUILD_DIR__: path.resolve(process.env.FRONTEND_BUILD_DIR || '../client/build')
__FRONTEND_BUILD_DIR__: process.env.FRONTEND_BUILD_DIR || '../client/build'
};

module.exports = config;

0 comments on commit b3513ed

Please sign in to comment.