Skip to content

Commit

Permalink
Merge pull request #232 from bento-platform/fix/prod-network
Browse files Browse the repository at this point in the history
fix: missing beacon network configuration + docs for env vars
  • Loading branch information
davidlougheed authored Nov 26, 2024
2 parents 68bb886 + 6244248 commit 4e9b76e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ it directly.
## Prerequisites:
- Node Package Manager

## Translations in dev mode
## Development

### Adding a new environment configuration variable

Any new environment / configuration variable must be registered in several places:

1. [`./create_config_prod.js`](./create_config_prod.js): mapping the environment variable to a config object entry for
production.
2. [`./webpack.config.js`](./webpack.config.js): setting a default value for the environment variable; used in Webpack development
builds.
3. [`./src/public/config.js`](./src/public/config.js): creating the shape of the global config object (using the config object entry key,
mapped to in 1.)
4. [`./src/js/config.ts`](./src/js/config.ts): loading from the global config object (production) via key or from the
environment variable directly, through Webpack replacement (development).

### Translations in dev mode
Add your English to French translations in `dist/public/locales/fr/translation_fr.json` for them to appear on the
website.
1 change: 1 addition & 0 deletions create_config_prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const siteConfig = {
TRANSLATED: parseBoolean(process.env.BENTO_PUBLIC_TRANSLATED),
BEACON_URL: process.env.BEACON_URL || null,
BEACON_UI_ENABLED: parseBoolean(process.env.BENTO_BEACON_UI_ENABLED),
BEACON_NETWORK_ENABLED: parseBoolean(process.env.BENTO_BEACON_NETWORK_ENABLED),

// Authentication
PUBLIC_URL: process.env.BENTO_PUBLIC_URL || null,
Expand Down
1 change: 1 addition & 0 deletions src/public/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BENTO_PUBLIC_CONFIG = {
TRANSLATED: null,
BEACON_URL: null,
BEACON_UI_ENABLED: null,
BEACON_NETWORK_ENABLED: null,
// Authentication
PUBLIC_URL: null,
CLIENT_ID: null,
Expand Down

0 comments on commit 4e9b76e

Please sign in to comment.