generate and parse querystring

This commit is contained in:
Matt Walsh
2024-04-11 23:42:51 -05:00
parent 5d00cf4608
commit 941bcacfad
8 changed files with 78 additions and 50 deletions

View File

@@ -1,8 +1,8 @@
// rewrite some urls for local server
const rewriteUrl = (_url) => {
let url = _url;
url = url.replace('https://api.weather.gov/', window.location.href);
url = url.replace('https://www.cpc.ncep.noaa.gov/', window.location.href);
url = url.replace('https://api.weather.gov/', `${window.location.protocol}//${window.location.host}/`);
url = url.replace('https://www.cpc.ncep.noaa.gov/', `${window.location.protocol}//${window.location.host}/`);
return url;
};