|
|
@@ -6,6 +6,13 @@ export class IrrigationForecastService {
|
|
|
constructor(private httpClient: HttpClient) {}
|
|
|
|
|
|
getForecast() {
|
|
|
- return this.httpClient.get('https://www.gis.atapex.sk/agrihub_forecast/');
|
|
|
+ const crossOrigin = !window.location.hostname.includes('gis.atapex.sk');
|
|
|
+ const proxyPath = window.location.hostname.includes('localhost')
|
|
|
+ ? 'http://localhost:8085/'
|
|
|
+ : '/proxy/';
|
|
|
+ return this.httpClient.get(
|
|
|
+ (crossOrigin ? proxyPath : '') +
|
|
|
+ 'https://www.gis.atapex.sk/agrihub_forecast/'
|
|
|
+ );
|
|
|
}
|
|
|
}
|