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.2: Pin wrangler version to fix hanging miniflare invocations; fix encoding headers for invocation responses
  • 0.1.1: Adapt for LocalStack v3.0
  • 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.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file localstack_extension_miniflare-0.1.3.tar.gz.

File metadata

File hashes

Hashes for localstack_extension_miniflare-0.1.3.tar.gz
Algorithm Hash digest
SHA256 af3aed8771aacb49b0e59613df7da0f613fa70826acb78ee790b85c36af86bf5
MD5 3784edd2e1cbbfd253590aded66c9a3c
BLAKE2b-256 113ee117d03b4962ee1e248755192af8606793a44d84c13904a8310bdbb1e040

See more details on using hashes here.

File details

Details for the file localstack_extension_miniflare-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for localstack_extension_miniflare-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a57a9530bf66b86c2152b00d1bbe440feae5165eb01995bc1dbcfd838af639de
MD5 2d0988bd81f63fb79682e6ac84429360
BLAKE2b-256 6b1360802d6203b95da155a16ab212fca953a92ae14d61954cfada85c0d2cbc1

See more details on using hashes here.

Supported by

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