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"
}
})
1 comment
[ 2.7 ms ] story [ 26.2 ms ] threadThis 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")
} // la fin```