In this example, an Edge Function is used to fetch a remote resource and send it to the client.
const RESOURCE_URL = 'https://data.playground.edgeone.ai/resource/image/png/edgeone-logo.png';
async function handleRequest() {
const response = await fetch(RESOURCE_URL);
return response;
}
addEventListener('fetch', event => {
event.respondWith(handleRequest());
});