Przeglądaj źródła

feat: configure senslog url from environment

fzadrazil 4 lat temu
rodzic
commit
ce559bfddb

+ 2 - 1
src/app/shared/api/endpoints/base-service.ts

@@ -3,6 +3,7 @@
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
 import { ApiConfiguration } from './api-configuration';
+import { environment } from '../../../../environments/environment';
 
 /**
  * Base class for services
@@ -15,7 +16,7 @@ export class BaseService {
   ) {
   }
 
-  private _rootUrl: string = '';
+  private _rootUrl: string = environment.sensLogBaseUrl;
 
   /**
    * Returns the root url for all operations in this service. If not set directly in this

+ 2 - 1
src/environments/environment.prod.ts

@@ -1,5 +1,6 @@
 export const environment = {
   production: true,
   baseHref: '/',
-  useMock: false
+  useMock: false,
+  sensLogBaseUrl: 'https://sensor.lesprojekt.cz'
 };

+ 2 - 14
src/environments/environment.ts

@@ -1,16 +1,4 @@
-// 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
+  production: false,
+  sensLogBaseUrl: ''
 };
-
-/*
- * 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.