Skip to content

Commit

Permalink
fix(build): add api url to environment map (#778)
Browse files Browse the repository at this point in the history
* fix (build): add api url to environment map

* test: update spec
  • Loading branch information
ksted authored Nov 5, 2024
1 parent 2ea34c2 commit 0aa6ac8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/web/build/configurator/AppConfigurator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dotenv.config({
export class AppConfigurator {
private environmentMap = {
FETCH_REMOTE_CONFIG: process.env.FETCH_REMOTE_CONFIG,
API_URL: process.env.API_URL,
API_ENDPOINT: process.env.API_ENDPOINT,
API_SECURITY_TOKEN: process.env.API_SECURITY_TOKEN,
CONFIG_ID: process.env.CONFIG_ID,
Expand Down
3 changes: 3 additions & 0 deletions apps/web/build/configurator/__tests__/AppConfigurator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ $color-2-secondary-900: 2 1 55;
beforeEach(() => {
vi.resetModules();
process.env.FETCH_REMOTE_CONFIG = 'true';
process.env.API_URL = 'https://api.example.com'
process.env.API_ENDPOINT = 'https://api.example.com';
process.env.API_SECURITY_TOKEN = 'securetoken';
process.env.CONFIG_ID = '1';
});

afterEach(() => {
delete process.env.FETCH_REMOTE_CONFIG;
delete process.env.API_URL;
delete process.env.API_ENDPOINT;
delete process.env.API_SECURITY_TOKEN;
delete process.env.CONFIG_ID;
Expand Down Expand Up @@ -109,6 +111,7 @@ $color-2-secondary-900: 2 1 55;

const EXPECTED =
`FETCH_REMOTE_CONFIG=true
API_URL=https://api.example.com
API_ENDPOINT=https://api.example.com
API_SECURITY_TOKEN=securetoken
CONFIG_ID=1
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/changelog_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- Headlines now use the configured font.
- Fixed layout shift on category page.
- The build script failed on Windows because of incompatibilities between file name pattern and operating system. The file name pattern now works on Windows.
- The build script now adds the `API_URL` to the environment if it exists.

### 👷 Changed

Expand Down

0 comments on commit 0aa6ac8

Please sign in to comment.