introduce useCorsProxy, per default only enabled for darksky and envcanada

This commit is contained in:
Karsten Hassel
2022-01-26 19:23:08 +01:00
parent 9f9c17ea8a
commit f04dd6b6cd
9 changed files with 22 additions and 43 deletions

View File

@@ -72,7 +72,7 @@ WeatherProvider.register("weatherbit", {
// Create a URL from the config and base URL.
getUrl() {
const units = this.units[this.config.units] || "auto";
return this.getCorsUrl() + `${this.config.apiBase}${this.config.weatherEndpoint}?lat=${this.config.lat}&lon=${this.config.lon}&units=${units}&key=${this.config.apiKey}`;
return `${this.config.apiBase}${this.config.weatherEndpoint}?lat=${this.config.lat}&lon=${this.config.lon}&units=${units}&key=${this.config.apiKey}`;
},
// Implement WeatherDay generator.