ws4kp/server/scripts/modules/utils/cors.mjs

13 lines
332 B
JavaScript
Raw Normal View History

2022-11-22 22:19:10 +00:00
// 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);
return url;
};
export {
// eslint-disable-next-line import/prefer-default-export
rewriteUrl,
};