Commits

William Welling authored and GitHub committed 648383405ad
Update config.ts
No tags

src/config.ts

Modified
1 1 // Look in ./config folder for config
2 2 import { OpaqueToken } from '@angular/core';
3 3
4 4 interface ServerConfig {
5 - "nameSpace": string,
6 - "protocol": string,
7 - "address": string,
8 - "port": number,
9 - "baseUrl": string
5 + "nameSpace": string;
6 + "protocol": string;
7 + "address": string;
8 + "port": number;
9 + "baseUrl": string;
10 10 }
11 11
12 12 interface GlobalConfig {
13 - "production": boolean,
14 - "rest": ServerConfig,
15 - "ui": ServerConfig,
13 + "production": boolean;
14 + "rest": ServerConfig;
15 + "ui": ServerConfig;
16 16 "cache": {
17 17 "msToLive": number,
18 18 "control": string
19 - },
19 + };
20 20 "universal": {
21 21 "preboot": boolean,
22 22 "async": boolean
23 - }
23 + };
24 24 }
25 25
26 26 const GLOBAL_CONFIG = new OpaqueToken('config');
27 27
28 28 let configContext = require.context("../config", false, /js$/);
29 29
30 30 let EnvConfig: GlobalConfig;
31 31 let EnvConfigFile: string;
32 32
33 33 let production: boolean = false;
39 39 EnvConfigFile = './environment.prod.js';
40 40 break;
41 41 case 'dev':
42 42 case 'development':
43 43 EnvConfigFile = './environment.dev.js';
44 44 break;
45 45 case 'test':
46 46 EnvConfigFile = './environment.test.js';
47 47 break;
48 48 default:
49 - console.warn('Environment file not specified. Using default.')
49 + console.warn('Environment file not specified. Using default.');
50 50 }
51 51
52 52 try {
53 53 EnvConfig = configContext('./environment.default.js');
54 54 } catch (e) {
55 55 throw new Error("Cannot find file ./environment.default.js");
56 56 }
57 57
58 58 // if EnvConfigFile set try to get configs
59 59 if (EnvConfigFile) {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut