firebase-on-cloudflare

0.0.4 • Public • Published

firebase-on-cloudflare

Is a Cloudflare Worker that reimplements Firebase's hosting logic.

Installation

$ yarn add firebase-on-cloudflare

Usage

import firecloud from 'firebase-on-cloudflare';
import { hosting as hostingConfig } from './firebase.json';

// Init once (globally) for better perfs
const fcloud = new firecloud('gitbook-staging', hostingConfig);

// Proxy (and cache) requests to Google Cloud Functions & Firebase Hosting
addEventListener("fetch", (event) => fcloud.serve(event));

Why ?

We (GitBook) built firebase-on-cloudflare to fix connection issues we had between Cloudflare and Fastly/Firebase Hosting.

Ideas

  • Allow routing to cloud-functions closest to users (rather than everything going to us-central1)

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i firebase-on-cloudflare

    Weekly Downloads

    4

    Version

    0.0.4

    License

    none

    Unpacked Size

    20.4 kB

    Total Files

    24

    Last publish

    Collaborators

    • aarono