working version, use corsUrl in weather providers

This commit is contained in:
Karsten Hassel
2022-01-25 22:30:16 +01:00
parent 7cfc7b9d74
commit c622db918b
10 changed files with 42 additions and 25 deletions

View File

@@ -111,6 +111,15 @@ const WeatherProvider = Class.extend({
this.delegate.updateAvailable(this);
},
getCorsUrl: function () {
const url = window.config.address + ":" + window.config.port + "/cors?url=";
if (window.config.useHttps) {
return "https://" + url;
} else {
return "http://" + url;
}
},
// A convenience function to make requests. It returns a promise.
fetchData: function (url, method = "GET", data = null) {
const getData = function (mockData) {