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 c3c8529
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ before_deploy:
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=
secure: JdNMi7Sag02GhhiEnUXp/k9bsJI5GY3jznRxMYn7cbRqyKcK16pAxnCb+2RVkwVVkUaGk1zUYcRU3aLP/LvKWllQ+6kXZ8G/ujTNJ/GRidYiQ6eCDFmwM6CmS5MywtuO7Yb/zNw7fEai6xcF53zPV6GxLLQfX6AtpZv5zls7IEzm32GxJELFotv3hLYYj7+Qu6dV8Y7tSSdNlHEUgo5Ldz1/mQGAT4ntEzaTZbGUIKQFVFID23YuD/imxDkfCT7Clx6V+1tg+IrW2eTIPKYTShfkn9N56vffbpyF+rL7lWd2FZGTE7yGAcKfRZng5ES87622IIJMnSoKWHY2FbCaXd5WNNOMPIuPSdLtjqTJ7N0p6BKGrXEAnFehmifAp+wmTxyz1cM83SVLHJj8DtD8PNcFmxS8y5J3b45wr+ui1Qb2rWRUdgAXIC6ptQqjrCRgdm3TdiBxOTVfZhkhz6e/KDTBG4A9Lzu6SznfimKyiTxZMGwhDXAdlhCmxFFvYX+9fTAsg/rFcLziPt+6ciHoUda6Y8TM8Lsi+yYZQWhysBDzLkrUatOcNZ32A+HB1oB9+jIF1ktBQdeVv7RxO9FUuT/+Y7ic3wN+L9REPuNcu44WIGu8mBJGwj6iGae111uuazk7R5Kt/3tY93iJZueJQuVP1H4qHIEZde8gg363oSc=
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 c3c8529

Please sign in to comment.