Skip to content

Instantly share code, notes, and snippets.

View mortenboldt's full-sized avatar

Morten Boldt mortenboldt

View GitHub Profile
@mortenboldt
mortenboldt / clouflare-worker-static-page-backblaze.js
Created January 27, 2022 18:19 — forked from maltechx/clouflare-worker-static-page-backblaze.js
Host a static page on Backblaze and distribute it via Cloudflare and their Workers.
// Imprved the script from this blog https://www.grahn.io/posts/2020-02-08-s3-vs-b2-static-web-hosting/
// Backblaze Url
const baseURL = "https://f000.backblazeb2.com/file/yourbucket"
addEventListener('fetch', event => {
event.respondWith(handleRequest(event))
})
async function handleRequest(event) {