Last active
August 17, 2022 02:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright Fauna, Inc. | |
# SPDX-License-Identifier: MIT-0 | |
version: "3.9" | |
services: | |
fauna: | |
image: fauna/faunadb:latest | |
ports: | |
- "8443:8443" | |
- "8444:8444" | |
- "8445:8445" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' }, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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