Socket
Socket
Sign inDemoInstall

cloud-blaze

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cloud-blaze

cloudflare workers handler for proxying requests to backblaze b2


Version published
Weekly downloads
4
Maintainers
1
Install size
10.7 kB
Created
Weekly downloads
 

Changelog

Source

[0.2.1] - 2020-12-23

fixed

  • missing index.d.ts in published tarball

Readme

Source

cloud-blaze

cloudflare workers handler for proxying requests to backblaze b2

about

this package enables using backblaze b2 as a back end for a website served via cloudflare workers. within certain limits, this is completely free! the bandwidth alliance as well as generous free-tier limits from backblaze and cloudflare make this possible.

get started

install

yarn add cloud-blaze

code

import the handler into your cloudflare workers code

import b2ProxyHandler from "cloud-blaze";

addEventListener("fetch", (event) => {
  event.respondWith(b2ProxyHandler({ event }));
});

setup

  1. setup cloudflare dns
  2. upload static files to b2
  3. deploy to cloudflare workers
    • wrangler publish -e <env>
  4. set bucket key and bucket key id as secret environment variables
    • wrangler secret put -e <env> <VAR_NAME>

configuration

environment variables

  • B2_APPLICATION_KEY: b2 application key to access private bucket
  • B2_APPLICATION_KEY_ID: b2 application key id
  • B2_BUCKET_PREFIX: b2 bucket prefix for serving files within a bucket folder
  • PUBLIC_PREFIX: public url prefix to proxy requests behind a certain pathname

function options

  • bucketKey: defaults to B2_APPLICATION_KEY
  • bucketKeyId: defaults to B2_APPLICATION_KEY_ID
  • bucketPrefix: defaults to B2_BUCKET_PREFIX
  • publicPrefix: defaults to PUBLIC_PREFIX

TODO

  • edge SSR + B2 bucket hosting

Keywords

FAQs

Last updated on 23 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc