Skip to content

Commit 662426f

Browse files
committed
reading os environment variables to project environments
1 parent 740e3ab commit 662426f

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

Diff for: src/environments/environment.prod.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
export const environment = {
2-
production: true
2+
production: true,
3+
environment: $ENV.ENVIRONMENT,
4+
APIKeys: {
5+
SomeAPIKey: $ENV.SomeAPIKey,
6+
SomeOtherAPIKey: $ENV.SomeOtherAPIKey
7+
}
38
};

Diff for: src/environments/environment.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
// The list of file replacements can be found in `angular.json`.
44

55
export const environment = {
6-
production: false
6+
production: false,
7+
environment: 'development',
8+
APIKeys: {
9+
SomeAPIKey: 'DEV API Key',
10+
SomeOtherAPIKey: 'DEV API Key 2'
11+
}
712
};
813

914
/*

Diff for: src/typings.d.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
declare var $ENV: Env;
2+
3+
interface Env {
4+
ENVIRONMENT: string;
5+
SomeAPIKey: string;
6+
SomeOtherAPIKey: string;
7+
}
8+
9+
interface GlobalEnvironment {
10+
$ENV: Env;
11+
}

0 commit comments

Comments
 (0)