diff --git a/angular.json b/angular.json index c2620600d88386f32b1706439de4a50b91e2da89..198d87f4e7f431310215dfe02710f31249d387b4 100644 --- a/angular.json +++ b/angular.json @@ -34,6 +34,14 @@ "crossOrigin": "use-credentials" }, "configurations": { + "dev": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.dev.ts" + } + ] + }, "production": { "fileReplacements": [ { @@ -67,9 +75,13 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "netex:build" + "browserTarget": "netex:build", + "proxyConfig": "conf/proxy.conf.json" }, "configurations": { + "dev": { + "browserTarget": "netex:build:dev" + }, "production": { "browserTarget": "netex:build:production" } diff --git a/package.json b/package.json index 20efa1e0a62d6f4d066fb11a70579e00422ba251..fac8b6a5804d026a3c6466b20646f144fdacb37c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve --configuration=dev", "build": "ng build", "test": "ng test", "lint": "ng lint && htmlhint", diff --git a/src/environments/environment.dev.ts b/src/environments/environment.dev.ts new file mode 100644 index 0000000000000000000000000000000000000000..e999dedbe91708f010ba099fed5b39a4d21df643 --- /dev/null +++ b/src/environments/environment.dev.ts @@ -0,0 +1,17 @@ +// 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 = { + production: false, + backend: 'http://localhost:8001/' +}; + +/* + * 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. diff --git a/src/environments/environment.ts b/src/environments/environment.ts index d2aa767e98fb4d3fe55ff3a052a77879c0ca9639..d6079ecdd5dbd99208060cf8bf3e1bbcb3d84bef 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,8 +4,7 @@ export const environment = { production: false, - // backend: 'http://10.162.163.20:8001/', - backend: 'http://localhost:8001/' + backend: 'http://10.162.163.20:8001/', }; /*