Proxy to download assets in an Environment like ProcessWire where you can't control the CORS-Headers in an effective way.
Use one of the following Examples to fetch an asset via Asset Proxy
.
Via GET-Request
const assetUrl = 'https://exmaple.com/assets/example.svg';
const apiUrl = 'https://asset-proxy.novu.ch/api/fetch/';
const url = apiUrl + '?url=' + encodeURIComponent(assetUrl);
axios.get(url).then(({data}) => {
console.log(data);
});
Via POST-Request
const assetUrl = 'https://exmaple.com/assets/example.svg';
const apiUrl = 'https://asset-proxy.novu.ch/api/fetch/';
axios.post(apiUrl, {
'url': assetUrl
}).then(({data}) => {
console.log(data);
});
Repo hosted on Github: https://github.com/teamnovu/novu-asset-proxy