const someHTML = `
Siteproxy
`
/**
* rawHtmlResponse delievers a response with HTML inputted directly
* into the worker script
* @param {string} html
*/
async function rawHtmlResponse(html) {
const init = {
headers: {
'content-type': 'text/html;charset=UTF-8',
},
};
return new Response(html, init);
}
addEventListener('fetch', event => {
const { url } = event.request;
return event.respondWith(rawHtmlResponse(someHTML));
})