I stand with the people of Ukraine during this heinous assault on their freedoms, their independence, and their very lives.

2021-02-06

Cloudflare Workers

 06 Feb 2021  Snippets

Cloudflare Workers

Proxy URL
addEventListener("fetch", (event) => {
  event.respondWith(
     fetch("https://paramdeo.com")
  );
});
Return HTML

Pass an entire HTML document as a variable in a Worker script:

async function handleRequest(request) {
  const init = {
    headers: {
      'content-type': 'text/html;charset=UTF-8',
    },
  }
  return new Response(someHTML, init)
}
addEventListener('fetch', event => {
  return event.respondWith(handleRequest(event.request))
})
const someHTML =  `
<!doctype html>
<html lang="en">
  <head>
  ...
`
Webmentions & Comments

ETH Deposit Address

BTC Deposit Address

Copyright © Paramdeo Singh. Made with ☕️ in Guyana. All Rights Reserved.

Last Site Build on 18 Mar 2022

1MB Club Badge

Paramdeo Singh Guyana

Riding the wave of consciousness in this treacherous mortal sea.

Technology Design Strategy Literature Personal Blogs