const html = `<!DOCTYPE html> <body> <h1>Hello World</h1> <p>This markup was generated by a Cloudflare Worker.</p> </body>`; async function handleRequest(request) { return new Response(html, { headers: { 'content-type': 'text/html;charset=UTF-8', }, }); } addEventListener('fetch', event => { return event.respondWith(handleRequest(event.request)); });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter