Skip to main content

LocalStack Extension: Miniflare

Project description

Miniflare LocalStack extension (experimental)

Install LocalStack Extension

This extension makes Miniflare (dev environment for Cloudflare workers) available directly in LocalStack!

⚠️ Please note that this extension is experimental and currently under active development.

Installing

localstack extensions install "git+https://github.com/localstack/localstack-extensions/#egg=localstack-extension-miniflare&subdirectory=miniflare"

How to use

To publish the sample application to Miniflare running in LocalStack, we can use the wrangler CLI with the following environment variables for local dev mode:

export CLOUDFLARE_API_TOKEN=test
export CLOUDFLARE_API_BASE_URL=http://localhost:4566/miniflare
wrangler publish

Note: if you're having troubles with this configuration, e.g., seeing "Fetch failed" error messages on wrangler publish, try using this API endpoint instead:

export CLOUDFLARE_API_BASE_URL=https://localhost.localstack.cloud:4566/miniflare

Once deployed, the Cloudflare worker can be easily invoked via curl:

$ curl http://hello.miniflare.localhost.localstack.cloud:4566/test
Hello World!

Change Log

  • 0.1.0: Upgrade to Miniflare 3.0
  • 0.0.1: Initial version.

License

The cloudflare/miniflare package and related tooling is licensed under the MIT License.

The code of this LocalStack Extension is published under the Apache 2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localstack-extension-miniflare-0.1.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page