1 comment

[ 2.7 ms ] story [ 26.2 ms ] thread
https://news.ycombinator.com/item?id=29240627 https://blog.cloudflare.com/workers-javascript-modules/

This is out of date: here is some now is cloud flare function boilerplate

```js

let body = `// sw.js this is runing in the browser service worker thread console.log("Hello Service Worker"); ` console.log("Hello From Cloudflair Build Land") export async function onRequest(ctx) { console.log("Hello from cloud flair request land")

    let r= ctx.request;
    let cf = ctx.cf;
    let p = Object.fromEntries(new URL(r.url).searchParams.entries());
    let h = Object.fromEntries(r.headers.entries());
    //todo get users personal application
    //todo build service worker js for app
    //todo inject analysis

    return new Response(body, {
        headers: {
            "Content-Type": "application/javascript",
            "X-ENDPOINT-BROWSER": "anon"
        }
    })
} // la fin

```