Skip to content

Instantly share code, notes, and snippets.

@rts-rob
Last active August 17, 2022 02:34
Show Gist options
  • Save rts-rob/0eb43a7ac8489730c72785d7a7baf205 to your computer and use it in GitHub Desktop.
Save rts-rob/0eb43a7ac8489730c72785d7a7baf205 to your computer and use it in GitHub Desktop.
Local development of Cloudflare Workers and Fauna with Fauna Dev and Miniflare
# Copyright Fauna, Inc.
# SPDX-License-Identifier: MIT-0
version: "3.9"
services:
fauna:
image: fauna/faunadb:latest
ports:
- "8443:8443"
- "8444:8444"
- "8445:8445"
// Copyright Fauna, Inc.
// SPDX-License-Identifier: MIT-0
const faunaClient = new faunadb.Client({
secret: "secret",
domain: "localhost",
port: 8443,
scheme: "http",
headers: { 'X-Fauna-Source': 'fauna-workers' },
});
# Copyright Fauna, Inc.
# SPDX-License-Identifier: MIT-0
# Install miniflare
npm install --save-dev miniflare
# Build your worker
npm build
# Run the built worker (in this case, index.mjs)
miniflare build/index.mjs --watch --debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment