Skip to content

Commit

Permalink
chore(environment): add test-server config (DSP-1650) (#443)
Browse files Browse the repository at this point in the history
* chore(environment): add test-server config (DSP-1650)

* chore: add command to run with test-server config
  • Loading branch information
kilchenmann committed May 20, 2021
1 parent af02332 commit a56a45b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
32 changes: 32 additions & 0 deletions angular.json
Expand Up @@ -71,6 +71,32 @@
"maximumWarning": "6kb"
}
]
},
"test-server": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test-server.ts"
}
],
"optimization": false,
"sourceMap": true,
"namedChunks": false,
"aot": true,
"extractLicenses": false,
"vendorChunk": false,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "8mb",
"maximumError": "8mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
}
}
},
Expand All @@ -82,6 +108,9 @@
"configurations": {
"production": {
"browserTarget": "dsp-app:build:production"
},
"test-server": {
"browserTarget": "dsp-app:build:test-server"
}
}
},
Expand Down Expand Up @@ -140,6 +169,9 @@
"configurations": {
"production": {
"devServerTarget": "dsp-app:serve:production"
},
"test-server": {
"devServerTarget": "dsp-app:serve:test-server"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"start-with-test-server": "ng serve --configuration=test-server",
"lint-ci": "eslint --color -c .eslintrc.js --ext .ts ./src/app",
"lint-local": "eslint --color --fix -c .eslintrc.js --ext .ts ./src/app",
"e2e": "ng e2e",
Expand Down
8 changes: 8 additions & 0 deletions src/config/config.test-server.json
@@ -0,0 +1,8 @@
{
"apiProtocol": "https",
"apiHost": "api.test.dasch.swiss",
"apiPort": 443,
"apiPath": "",
"jsonWebToken": "",
"logErrors": true
}
19 changes: 19 additions & 0 deletions src/environments/environment.test-server.ts
@@ -0,0 +1,19 @@
/*
* This file can be replaced during build by using the `fileReplacements` array.
* `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
* The list of file replacements can be found in `angular.json`.
*/

export const environment = {
name: 'test-server',
production: false
};

/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.

0 comments on commit a56a45b

Please sign in to comment.